Vault

Vault

7M Downloads

Feature request: Array of Permission Nodes

Xcelsior91 opened this issue ยท 5 comments

commented

Hey there,
could you add the possibility to get all of the permission nodes a group and/or a player has?
I'm trying to write a spout-gui which lets you edit your permission files ingame, and it would be pretty convenient if I could show all of the nodes someone already has.
You know, something like 'public String[ ] get[Player/Group]Permissions(String [Player/Group][, String world])' or something like that?

commented

get the nodes from the player directly.. there's no reason to do it via Vault API when you can get a player's effective permissions via Bukkit. Just my thoughts.

commented

You mean with [Player].getEffectivePermissions()? Ok, so with that I can get the Permissions for singeld out players, but most of the time, permissions are stored in groups, so when I edit it for one user, i'd have to do it for every other user in the same group manually? Because afaik SuperPerms does not know anything like groups.

commented

correct, but if I were to add API for it, I'd have to do the same thing anyway. generally it's a horrible idea to do anything like this by the way as it's incredibly intensive on the server and can cause lots of lag.

commented

sigh ok, so much for this feature then...would have been nice to have in my plugin, but then i'll have to go with simple adding/removing permission nodes without showing the list...thanks anyway, just hoped you'd know a simple way to do this since you are more into this matter than me^^

commented

yah it's not quite as simple. because of how the permission nodes are resolved. If you wanted to get permissions just for a specific object without inheritence, that operates fairly quickly across all systems. As soon as you want to handle inherited nodes the performance decrease compounds. And on top of this, none of the permission systems actually have a getAllPermissions() method. So I'd either need to do reflection or dig out the permissions some other way.