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 support for the permission requirement for flags #517

Open
WhyZerVellasskx opened this issue Jan 31, 2025 · 3 comments
Open

Add support for the permission requirement for flags #517

WhyZerVellasskx opened this issue Jan 31, 2025 · 3 comments
Labels

Comments

@WhyZerVellasskx
Copy link

Hello, can you please implement @FlagPermission("flag_name", "permission.for.this.flag") this will be quite useful, for example, if you make the /kill command and that the player cannot use /kill --forced if there is no right.

@vLuckyyy
Copy link
Collaborator

vLuckyyy commented Jan 31, 2025

my idea:
maybe @Flag(flag = "--force", permission = "command.flag.force")


temponary solution:
just create another command definition's:

@Command(name = "kill --force)
@Permission("permission")

Important:
Using your (or my idea) idea makes the commands definition execute(context, arg1, arg2, arg3, flag, flag, flag, flag, [...]) harder to read.

@WhyZerVellasskx
Copy link
Author

Yes, that's true, but it's still better to use flag for such moments, but it's a pity that you can't add permission for the flag. I liked your idea. I hope they can implement it.

@Rollczi
Copy link
Owner

Rollczi commented Feb 2, 2025

my idea:

@Flag("-flag") @Permission("some.permission") boolean flag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

3 participants