-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support "OR" behavior for permissions. #429
Comments
You must need all required permissions. |
Is there any way to achieve this requirement? |
No, but you can implement validator on your own. |
I think this feature is quite common, and since this annotation is "Repeatable", it should support "or" judgment. Otherwise, just write all permissions in a single annotation and it's over. |
This change in the behavior of the @Permission annotation may affect the security of other projects. |
I think it would be to just let the user implement a OrPermission annotation if they require this functionality. |
This is what I am thinking about, too. But since |
I fount that it is impossible to support this function if not change the original codes. So may you make it
Or
Whatever the solution you choose, all means you may need to move "@Permission" meta from a single List to a MultiList or List<List>, to make this function possiable. Anyway, many thanks for you hard-working! |
Notice: Whatevet the mode is, if a player want to execute one subcommand, he should have the command's parents' permissions, e.g.
which means if i want to execute |
@huanmeng-qwq and I have finished this feature, but there're some problems need for discuss, please see the pull request. |
I expect that one instruction supports multiple different permissions, and the user only needs to have one set of permissions to execute the corresponding instruction.
It seems like
And I saw the
@Permission
is "Repeatable" annotation, but I just tested with 2 seperated@Permission
for different permissions, also need to have all of them. It's that a mistake?The text was updated successfully, but these errors were encountered: