LuckPerms

LuckPerms

41.4k Downloads

Shorthand permission commands

selfslaughter opened this issue ยท 4 comments

commented

Shorthand permission commands don't expand automatically, or override existing permissions of the same weight even when set to false.

Since they don't expand into individual permissions upon command completion, you also can't check the individual permissions.

  • Both permissions are individually set to true
> lp group donor0 permission checkinherits worldedit.navigation.jumpto.tool survival world
[15:12:47 INFO]: [LP] donor0 has permission worldedit.navigation.jumpto.tool set to true in context server=survival, world=world. (inherited from self)
> lp group donor0 permission checkinherits worldedit.navigation.jumpto.command survival world
[15:12:50 INFO]: [LP] donor0 has permission worldedit.navigation.jumpto.command set to true in context server=survival, world=world. (inherited from self)
  • Use a shorthand command to set them to false
> lp group donor0 permission set worldedit.navigation.jumpto.{tool,command} false survival world
[15:12:57 INFO]: [LP] Set worldedit.navigation.jumpto.{tool,command} to false for donor0 in context server=survival, world=world.
  • They are still true
> lp group donor0 permission checkinherits worldedit.navigation.jumpto.tool survival world
[15:13:03 INFO]: [LP] donor0 has permission worldedit.navigation.jumpto.tool set to true in context server=survival, world=world. (inherited from self)
> lp group donor0 permission checkinherits worldedit.navigation.jumpto.command survival world
[15:13:08 INFO]: [LP] donor0 has permission worldedit.navigation.jumpto.command set to true in context server=survival, world=world. (inherited from self)
  • A new shorthand permission was created as is, but still allows the individual permissions true values.
> lp group donor0 permission checkinherits worldedit.navigation.jumpto.{tool,command} survival world
[15:13:19 INFO]: [LP] donor0 has permission worldedit.navigation.jumpto.{tool,command} set to false in context server=survival, world=world. (inherited from self)
  • Need to use the exact same syntax to check the permissions (swapping command/tool doesn't work even though the end result should be the same)
> lp group donor0 permission checkinherits worldedit.navigation.jumpto.{command,true} survival world
[15:22:54 INFO]: [LP] donor0 has permission worldedit.navigation.jumpto.{command,true} set to undefined in context server=survival, world=world. (inherited from self)

Version Info

> lp info
[16:10:01 INFO]: [LP] Running LuckPerms v5.1.16 by Luck.
[16:10:01 INFO]: [LP] -  Platform: Bukkit
[16:10:01 INFO]: [LP] -  Server Brand: Paper
[16:10:01 INFO]: [LP] -  Server Version:
[16:10:01 INFO]: [LP]      git-Paper-282 (MC: 1.15.2) - 1.15.2-R0.1-SNAPSHOT
[16:10:01 INFO]: [LP] -  Storage:
[16:10:01 INFO]: [LP]      Type: MySQL
[16:10:01 INFO]: [LP]      Ping: 2ms
[16:10:01 INFO]: [LP]      Connected: true
[16:10:01 INFO]: [LP] -  Messaging: Sql
[16:10:01 INFO]: [LP] -  Instance:
[16:10:01 INFO]: [LP]      Static contexts: server=survival
[16:10:01 INFO]: [LP]      Online Players: 0 (0 unique)
[16:10:01 INFO]: [LP]      Uptime: 2h 53m 2s
[16:10:01 INFO]: [LP]      Local Data: 0 users, 14 groups, 5 tracks
commented

Shorthand is (xxx|yyy), not {xxx,yyy}. And individual permissions have precedence over shorthand permissions. That is intentional.

commented

You can add only one permission at a time with commands anyways.

additionally I don't see any added complexity with the current system.

commented

It's just an idea/suggestion. But having the option to be able to disable shorthand permissions as such, and expand upon command completion into the individual permissions could be incredibly useful and remove a layer of complexity.

commented

The checkinherits command looks for an exact match, it's not a "real" permission check.

For that, use the /lp check command.

https://github.com/lucko/LuckPerms/wiki/Command-Usage:-General#lp-check-user-permission

The shorthand stuff seems to be behaving correct from what I can tell.