LuckPerms

LuckPerms

41.4k Downloads

removing permissions inheritance when primary group is switched

Opened this issue ยท 11 comments

commented

When you switch a user's primary group they still receive permissions from the previous group.

For example: say CoolDude is an admin and i want to change their permissions to mod. I use "/lp user player switchprimarygroup mod" but they still receive permissions from the admin group because it is one of the "parent groups."

Is there a reason for this? If so could you please explain?
If not, i would love it if when you switch a player's primary group it removes the old parents and only inherits permissions from their new primary group's parents (and any other secondary/per server groups).

Even if this isn't added, i will continue to use and love this plugin! Thanks!

commented

Use parent set instead of switchprimarygroup.

e.g.

/lp user Luck parent set mod
commented

thanks so much!

commented

will this also change prefix etc?

commented

yep.

commented

Using latest build (Both 3.3.19 and 3.3.13) I'm facing the following issue:

https://pastebin.com/wNV7ysXi

Using lp user parent set mod is correctly changing player's default group, but not clearing all previous "Parents Group" that are defined when user logs in. As a result, the user still has extra permissions in default world.

The config file is left as default.
How to fix this tho?

Thanks

commented

In short, how to clear world context related parent groups when changing user primary group?
And why isn't "parent set" doing it automatically?

I'm looking for a command / set of commands that behaves exactly as pex user Player group set group would, and parent set itself doesn't seem to be a good fit.

commented

Parent set only removes groups in the same context.

To achieve what you're asking for, you need to run parent clear before parent set.

commented

First let me thank you for this blazing fast reply ๐Ÿ‘

Ok that's what I ended up "guessing" but was wondering if a single command could do the same job.
Is there any way to prevent these world contexts from showing up? (Upon user login and world change)
Thanks ๐Ÿ˜‰

commented

A plugin is most likely adding those permissions via Vault.

You can either

  • Remove that plugin
  • Ask the author of that plugin to fix the incorrect behaviour
  • Enable the workaround in LuckPerms for 'vault ignore world' in the config.

p.s In future, its best to open a new ticket for your issue, instead of commenting on an old/closed one ๐Ÿ˜„

commented

Wait, so it's not LuckPerm but another plugin causing this?
It doesn't seem it was the case when I was previously using PermissionsEx, maybe it wasn't behaving exactly the same regarding this context "issue".

Thanks for your time, if you're right (and I guess you are), I'll go find the culprit.

Ps: Yes I know it's best practice to open a new issue but as I searched the issues I wasn't sure if it was a plugin issue (LuckPerm) or something conflicting with it / bad configuration, I didn't want to open a "wrong" / "irrelevant" issue.

commented

Yes indeed I found out it was AuthMe (reloaded) causing this issue. If anyone runs into the same trouble, here's how to fix it (temporary):

The issue here is the GroupOptions->enablePermissionCheck option, very useful per se to prevent almost all major exploits (switching the user to a specific group during login time and then switching him back to normal).
But it seems the feature is poorly made, and thus conflicts with some permissions plugins. (Adding contexts parents, instead of global ones).

I guess I need to open an issue on their Github project.