Skip to content
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

Add option to set permission for optional arguments #262

Open
Rollczi opened this issue Oct 24, 2023 · 0 comments
Open

Add option to set permission for optional arguments #262

Rollczi opened this issue Oct 24, 2023 · 0 comments
Labels
enhancement New feature or request hacktoberfest This year we’re celebrating 11 years of open source love! https://hacktoberfest.com/

Comments

@Rollczi
Copy link
Owner

Rollczi commented Oct 24, 2023

e.g.
@Permission("flag.permission") @Flag("-s") boolean silent
@Permission("arg.permission") @Arg String Option<String> text

I don't know yet if this should be implemented, because it may be more readable to handle such cases yourself.

@Execute
void ban(@Context CommandSender sender, @Arg Duration time, @Flag("-s") boolean silent, @Join String reason) {
    if (sender.hasPermission("flag.permission") && silent) {
        // ...
    }
}
@Rollczi Rollczi added enhancement New feature or request hacktoberfest This year we’re celebrating 11 years of open source love! https://hacktoberfest.com/ labels Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest This year we’re celebrating 11 years of open source love! https://hacktoberfest.com/
Projects
Status: Todo
Development

No branches or pull requests

1 participant