EssentialsX

EssentialsX

2M Downloads

Incompatibility with LuckPerms regex permissions

Evidentsinger14 opened this issue ยท 4 comments

commented

Type of bug

Other unexpected behaviour

/ess dump all output

https://essentialsx.net/dump.html?id=25caaaed4d3842e19888234209733321

Error log (if applicable)

n/a

Bug description

When setting up prevent-type permissions using regex in LuckPerms r=essentials\.hat\.prevent-type\.(.*)_shulker_box to block all shulker boxes from being used as a /hat, the permissions are never checked. I have confirmed that the permission actually works in LuckPerms, as it shows to be set to true.
Image 1
Image 2
It also does not show as being checked when /ess debug is enabled (is in the log, but here's the output)

Steps to reproduce

  1. run /lp user <username> permission set r=essentials\.hat\.prevent-type\.(.*)_shulker_box true (as well has essentials.hat)
  2. give yourself a red shulker box (any color will work as long as it's (something)_shulker_box
  3. try to put it on your head with /hat

Expected behaviour

send the message to the player "You must have something to wear in your hand.", and fail to apply the hat.

Actual behaviour

The hat is applied, and permissions are never checked for it.

commented

I don't really want to be hooking into specific permissions plugins to inspect the specific nature of how they allow admins to assign permissions.

We could add a config option to not require explicit setting of permissions (enabling both wildcards and regexes), but I'm not sure how ideal this would be.

commented

Does this occur when you set a non-regex permission for something that isn't shulker boxes, or is it specific to shulkers?

commented

Does this occur when you set a non-regex permission for something that isn't shulker boxes, or is it specific to shulkers?

The problem only occurs with regex permissions as far as i've seen. The permissions show in LuckPerms correctly (as in checking the perms with /lp user <user> permission check <permission will show it), but the permissions will not work. i know the prevent-type permissions worked when manually added, i only stumbled on this when trying to condense my permission list.

commented

The problem is Essentials will check the users defined permissions when checking prevent-type (so op and wildcards do not break everything). I don't really know of a proper way to fix this inside of Essentials, this would require LuckPerms adding some API method like isPermissionDeclared which returned true if the given permission was explicitly set in their group (excluding wildcards and respecting regex).