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

Multiple Permissions in a command #6560

Open
1 task done
EquipableMC opened this issue Apr 12, 2024 · 8 comments
Open
1 task done

Multiple Permissions in a command #6560

EquipableMC opened this issue Apr 12, 2024 · 8 comments
Labels
up for debate When the decision is yet to be debated on the issue in question

Comments

@EquipableMC
Copy link
Contributor

EquipableMC commented Apr 12, 2024

Suggestion

I was hoping there would be a way we could add multiple permissions to a command, but if you have one of the permissions, it would work.
Example:

command /test:
    permission: test, test2, testing.test
    trigger:
        send "testing" to player

Why?

This would make it super useful for making a command with different permissions so you dont have to do one permission and can just make it multiple.

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this suggestion.
@Fusezion
Copy link
Contributor

Shouldn't be hard to implement but I don't see the appeal of having two or more permissions just to use a skript command

@EquipableMC
Copy link
Contributor Author

It might be useful for say you want to sell it as a perk (permission 1) and you want to also sell it as one of the perks to a rank (permission 2)

@Moderocky
Copy link
Member

This doesn't really seem like a valuable addition.

Firstly, it's not doing anything you can't do by just checking the permissions yourself at the beginning of the trigger: section.

Secondly, it's actually worse than this, since it's unclear how the permissions are supposed to be compared: does player need test AND test2? test OR test2? test XOR test2?
If I write permissions: rank.admin, chatcolor.red does that mean a player needs either rank.admin or chatcolor.red? Both? One but not both?

I'm pretty sure lists default to AND (but I don't remember off the top of my head) so this would mean the player needs to have all of the listed permissions. In the best case scenario this is just going to confuse users who think it's one way when it's the other.

@AyhamAl-Ali AyhamAl-Ali added the up for debate When the decision is yet to be debated on the issue in question label Apr 13, 2024
@EquipableMC
Copy link
Contributor Author

EquipableMC commented Apr 13, 2024

This doesn't really seem like a valuable addition.

Firstly, it's not doing anything you can't do by just checking the permissions yourself at the beginning of the trigger: section.

Secondly, it's actually worse than this, since it's unclear how the permissions are supposed to be compared: does player need test AND test2? test OR test2? test XOR test2? If I write permissions: rank.admin, chatcolor.red does that mean a player needs either rank.admin or chatcolor.red? Both? One but not both?

I'm pretty sure lists default to AND (but I don't remember off the top of my head) so this would mean the player needs to have all of the listed permissions. In the best case scenario this is just going to confuse users who think it's one way when it's the other.

Ahh yeah I forgot lists defaulted to and. I guess we could make it so you can do test1 or test2 or test3 and not support ands I guess? I don't really know if that's possible or not, I just really want to see want everyone thinks of this.

and regarding the first statement, yes you could do that, but sometimes I find it quite annoying to do and wish I could just specify it in the permission: statement.

@sovdeeth
Copy link
Member

sovdeeth commented Apr 13, 2024

There is some merit is not doing it in the trigger, as it allows bukkit to properly choose who to send the command too, but I agree it would be confusing as is. "And" and "or" would go some way to help but we might need more explicit syntax for something like this.

However, it'd be best to create a command-specific permission and just give that to various groups that need to run the command. It's how permissions plugins are meant to be used.

@Moderocky
Copy link
Member

Moderocky commented Apr 13, 2024

There is some merit is not doing it in the trigger, as it allows bukkit to properly choose who to send the command too

Hang on, are we sure Bukkit supports multi-permissions behaviour? If so, is it an AND or an OR? That might decide whether we can proceed with this.

Edit: as far as I can tell, Bukkit commands support only a single permission in the command metadata. Unless we have a way around this ourselves, the point seems kind of moot.
Edit 2: I am wrong, you can separate them by a ; and it tests them all silently, but it's exclusively an AND mode, so the suggested behaviour wouldn't be supported.

@EquipableMC
Copy link
Contributor Author

Oh I did not know it was in exclusively an AND mode. That's good to know though.

@Moderocky
Copy link
Member

Uh just double check this, but you may already be able to use it by just entering permission.a;permission.b as your permission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
up for debate When the decision is yet to be debated on the issue in question
Projects
None yet
Development

No branches or pull requests

5 participants