LuckPerms

LuckPerms

41.4k Downloads

Add ability to set include-global etc. settings per group

Phoenix616 opened this issue ยท 5 comments

commented

Currently it is only possible to set settings for how global server and world permissions are handled for the whole server via the config.yml. It would be nice to have the ability to change this setting on a per group basis depending on the context that the player is in. That way you could have certain groups include their global permissions on a server (staff groups) while others only get their server specific ones applied. (players in different gamemodes)

commented

Yeah, again I see what you mean, but it's still solvable with static contexts.

In your servers where global permissions should apply, you can define your own context in the static contexts file, and have those permissions only apply when the context is met.

I'm also not really sure of a way to easily implement your suggestion. Groups don't have attributes in this sense.

commented

Well it could be just added the same way as weights, parents and permissions in general are. E.g. if the attribute isn't set for a group then it's using the global setting from the config.yml and if it is set then use the value to get whether or not it's enabled or disable.

But I'll definitely will look into the static contexts. Is there some documentation about that somewhere?

commented

Static contexts refers to the file which sits in the LuckPerms folder. It's basically just the contexts which should be granted to all users by default. (hence "static")

General documentation on contexts as a whole can be found here:
https://github.com/lucko/LuckPerms/wiki/Command-Usage#what-is-context

or here:
https://docs.spongepowered.org/stable/en/plugin/permissions.html#contexts (since the LP system is based off the system created by Sponge)

commented

If that's the case, just don't ever assign global permissions to your player groups, then you always have control over which applies.

As of 3.1, you can create your own contexts (your own "server" variable), which may also be a solution to this. You can then setup special "groups" of servers, and only have permissions apply on those.

I don't think refining these options further is necessary given the control you get from custom contexts.

commented

I don't think that this is a good solution for that problem as you would have to set all permissions to only apply on a certain group of servers and not the other one, prompting you to change the context every time you add or remove a new server to that group. Imo. permissions that apply to nearly all servers should still be global, and the include-global setting is exactly there for servers where the global permissions shouldn't apply.

Providing the ability to decide that on a per group basis rather than globally on the server seems to be a better solution for me instead of having to write a separate plugin that tries to add this functionality with contexts or something similar. Granted this issue is kinda related to #254 as I noticed this flaw when trying to find a solution for the same problem (per server group/permission inheritance without the global permissions while still keeping the player's rank intact) but both of them result in a different set of other possible use cases of the features.