EssentialsX

EssentialsX

2M Downloads

[feature] Make SuperPerms's "*" feature optional

IliasDewachter opened this issue ยท 7 comments

commented

I was wondering if you could make a simple feature in the config to enable/disable the "*" permission workaround in
https://github.com/drtshock/Essentials/blob/2.x/Essentials/src/com/earth2me/essentials/perm/impl/SuperpermsHandler.java
I would like to request this because I'm creating a permissionplugin and it's ruining the essential-permissions.
Thanks

commented

I think you might be confused about how this works.
It checks the permissions in order, using the 'isPermissionSet' method in bukkit, until it gets a response.

ie if the permission was 'essentials.example.perm.2' it would do a 'isPermissionSet' on the following perms in order:
essentials.example.perm.2
essentials.example.perm.*
essentials.example.*
essentials.*

Two things can happen here. If any of the above perms 'pass' ie return true, then essentials stops looking and requests 'hasPermission' to see if the perm check should be a pass/fail.
If none of the above permissions 'pass', meaning none of the matched permissions are set, it does a perm check on '*', to see if the global perm state is to pass/fail.

If you are seeing perm checks on '*', that means your plugin isn't correctly setting the 'isPermissionSet' flag.

Also, #essentials is not the channel for requesting help with EssentialsX.

commented

If you are overwriting a system not intended to be replaced, it is your job to fix the problems from your end. It is not the job of anyone whose things stop working on your hack job.

commented

I've overridden the player.hasPermission() method. I don't use the default Bukkit permissions system (with the PermissionAttachments). That's why EssentialsX only checks for the "*" permission node since I don't set the permissions on the Superperms way.

A simple boolean in the config to disable this, by just calling player.hasPermission(node), would solve my problem and I could avoid a nasty injector.

commented

If you are overwriting the haspermission method I Bukkit, you need to also overwrite the ispermissionset method too. Even if it's only to set it to always true.

commented

Now I feel silly for not coming up with that...

Thanks for the help!
I'll close this ticket if it's fixed.

commented

It worked, closing ticket

commented

No it isn't, but does that mean I can't suggest a feature that helps me to accomplish this?