Allow PredicatePermissions to return a PermissionResult#545
Merged
jpenilla merged 28 commits intoIncendo:2.0.0-devfrom Jan 14, 2024
Merged
Allow PredicatePermissions to return a PermissionResult#545jpenilla merged 28 commits intoIncendo:2.0.0-devfrom
jpenilla merged 28 commits intoIncendo:2.0.0-devfrom
Conversation
Konicai
commented
Dec 5, 2023
...aft/cloud-fabric/src/main/java/cloud/commandframework/fabric/FabricClientCommandManager.java
Outdated
Show resolved
Hide resolved
da24f3b to
bc3ef11
Compare
powercasgamer
suggested changes
Dec 6, 2023
cloud-core/src/main/java/cloud/commandframework/CommandManager.java
Outdated
Show resolved
Hide resolved
Citymonstret
requested changes
Dec 6, 2023
cloud-core/src/main/java/cloud/commandframework/CommandTree.java
Outdated
Show resolved
Hide resolved
cloud-core/src/test/java/cloud/commandframework/exceptions/NoPermissionExceptionTest.java
Outdated
Show resolved
Hide resolved
cloud-core/src/main/java/cloud/commandframework/permission/WrappingPredicatePermission.java
Outdated
Show resolved
Hide resolved
cloud-core/src/main/java/cloud/commandframework/permission/SimplePermissionResult.java
Outdated
Show resolved
Hide resolved
cloud-core/src/main/java/cloud/commandframework/permission/PredicatePermission.java
Outdated
Show resolved
Hide resolved
cloud-core/src/main/java/cloud/commandframework/permission/PermissionResult.java
Outdated
Show resolved
Hide resolved
cloud-core/src/main/java/cloud/commandframework/permission/PermissionResult.java
Outdated
Show resolved
Hide resolved
cloud-core/src/main/java/cloud/commandframework/permission/PermissionResult.java
Outdated
Show resolved
Hide resolved
Member
|
as mentioned on discord, the result for an empty and permission shouldn't be changed. but requiring a non empty set also sounds reasonable. |
Co-authored-by: Alexander Söderberg <4096670+Citymonstret@users.noreply.github.com>
Contributor
Author
|
thank you - got busy the last couple days. I'll be able to finish this today or tomorrow |
Member
absolutely no rush, I just figured I'd help keep it up to date with 2.0.0-dev as it's still moving quite fast 😅 |
Closed
Contributor
Author
|
@jpenilla can i get some guidance/clarification on the direction i should take with AndPermission/OrPermission :) |
# Conflicts: # cloud-core/src/main/java/cloud/commandframework/CommandManager.java # cloud-core/src/main/java/cloud/commandframework/CommandTree.java # cloud-core/src/main/java/cloud/commandframework/exceptions/NoPermissionException.java # cloud-core/src/main/java/cloud/commandframework/permission/AndPermission.java # cloud-core/src/main/java/cloud/commandframework/permission/CommandPermission.java # cloud-core/src/main/java/cloud/commandframework/permission/OrPermission.java # cloud-core/src/main/java/cloud/commandframework/permission/PredicatePermission.java # cloud-core/src/test/java/cloud/commandframework/CommandPermissionTest.java
Member
|
I merged in the changes from #578, hopefully I didn't butcher it too badly. |
# Conflicts: # cloud-core/src/main/java/cloud/commandframework/CommandTree.java # cloud-core/src/main/java/cloud/commandframework/exceptions/NoPermissionException.java # cloud-minecraft/cloud-fabric/src/main/java/cloud/commandframework/fabric/FabricClientCommandManager.java # cloud-minecraft/cloud-fabric/src/main/java/cloud/commandframework/fabric/FabricCommandManager.java
Citymonstret
previously approved these changes
Jan 13, 2024
resolving merge conflicts using the github ui = bad
Citymonstret
previously approved these changes
Jan 13, 2024
Contributor
Author
|
thank you for finishing it up... a bit taken by life right now 😆 |
jpenilla
approved these changes
Jan 14, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A few things:
AndPermissionandOrPermissionhad loose definitions of what to do when empty.OrPermissionalready resulted in false, but I added a check forAndPermissionso that it now also results in false. I was thinking of requiring a non-empty Set in their constructors, and also moving the iteration to the respective classes. Can't move much more up without introducing a generic to CommandPermission, which seems yucky.PermissionLevelResultwith a private constructor and a static factory method. But then I figured that it wouldn't hurt to allow the class to be extended. So then I was looking at a protected constructor and a static factory method, and I figured to just have a public constructor. It feels like I'm getting bureaucratic. Maybe a middle ground?