feat(perm): Support PermissionValidator for different permission check behaviors. #512
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.
link #429
In this PR, Meta of "Permisisons" changed to
Set<Set<String>>
, witch makes developers can easily hanle multiple@Permissions
annotation, means each@Permission
splited to a single Set, and each permission are put into it.Also, this pr supplied 2 different PermissionValidator, with
STRICT
(behaviors like before) andPARALLEL
(match any one of permissions' set). And the default one is "Strict", which should keep the same behavior as before, and may not affect current users.Anyway, due developing, we found there's some problems that
testPermissionSilent
method in different platforms using a staticMissingPermissions#check
method to test permissions. That makes it difficult to active custom PermissionValidator in root commands' check.To avoid changes in platforms, you may need to think how to recode it to make it possible to read validators or any other settings of builder supplied in platform manager.
Many thanks for your review!