LuckPerms

LuckPerms

41.4k Downloads

Meta Priority

Sir-Will opened this issue ยท 23 comments

commented

hey,

is there currently a way to set a priority for meta entries like you can do for prefix/suffix? If not any chance this could get added?

I tried to workaround this by creating a group with the meta and setting a higher weight but this weight seems to be ignored if you add the group as parent to a group with a lower weight.

commented

No meta nodes don't have a priority - and I think adding a weight property would be beyond what they should be used for.

The full accumulated ListMultimap is exposed in the API - with values in the order they were inherited.

https://github.com/lucko/LuckPerms/blob/f8d34d7f467594bc5d8cc1c050db4bdad23d91d3/api/src/main/java/me/lucko/luckperms/api/caching/MetaData.java#L53-L66

commented

This is how the meta looks like:

home-count 8 is at the top but I can only use 3.

commented

@lucko is the meta list (/perm user ... meta info) ordered by weight?

commented

Uhh, no, I don't think so

commented

Hm, any idea how I could solve that without creating a new plugin and using the LP api?

commented

Hm, you mean sorting the output in the meta info command?

commented

No, I'm trying to get nucleus to use the home-count 8 (which comes from the inherited group perms_home8 which has a higher weight then tier2) instead of the home-count 3 (which comes from tier2 group).

The tier2 group is directly added to the user while perms_homes8 is a tempgroup which the user inherits from the default group.

commented

I've re-opened this to remind myself to reply - and will leave it open until we can work out a solution :)

I'm quite tired at the moment so can't really give this issue my full thought - I'll try look into this a bit more / work out a reply sometime tomorrow - if that's okay. ๐Ÿ˜„

commented

Alright thanks, I appreciate your help :)

commented

Yup it's all at the bottom :/

commented

Ok, that ^ commit will make the meta info command output in values in inheritance order - which is the same order used by the getOption method in the LP sponge implementation.

commented

That's simply because tier2 and tier1 are being inherited before perms_homes8 and perms_homes5

commented

Any idea how I could solve this?

commented

Give them higher weights

commented

They already have that

commented

You also need to consider the weights of the groups they're inherited through.

Those will be considered first

commented

Unfortunately I can't change that for the default group. I guess there is no other way in giving the group to everyone and overwriting their existing groups?

commented

Are they inherited via something else though?

commented

Yes, perms_homes is inherited from default.

commented

Uhh nope, that's the nature of how the system works.

You might be able to change the inheritance order mode to achieve what you want - but beyond that, there's not much I can do, this is intended behaviour of the system.

https://github.com/lucko/LuckPerms/wiki/Configuration#inheritance-traversal-algorithm

commented

Hm, I don't see that option in my config with LuckPerms-Sponge-4.1.68. Is that not in the version I'm using or do I need to manually add it?
Also is there currently any way to give a player a permission until he logs out?

commented

You'll need to manually add it, the config doesn't update automatically.

It is possible, but not using commands.

You can do it via the Sponge API or the LP API using "transient" permissions.

commented

Alright, thanks.