Skript

Skript

743k Downloads

Multiple Permissions in a command

EquipableMC opened this issue ยท 8 comments

commented

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.
commented

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

commented

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)

commented

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.

commented

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.

commented

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.

commented

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.

commented

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

commented

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