ChestShop-authors / ChestShopNotifier

Bukkit plugin that allows your players to see who bought or sold what while they were offline.
https://www.spigotmc.org/resources/chestshopnotifier.30313/
10 stars 8 forks source link

Command /csn history checking wrong permission #58

Open Tsuser1 opened 2 years ago

Tsuser1 commented 2 years ago

Hello,

I'm currently having an issue where /csn history is attempting to check for csn.command and not csn.command.history as seen here:

> sudo dalphinian csn history
[01:21:15 INFO]: CONSOLE issued server command: /sudo dalphinian csn history
[01:21:15 INFO]: Forcing dalphinian to run: /csn history
[01:21:15 INFO]: dalphinian issued server command: /csn history
[01:21:15 INFO]: [LP] VB > dalphinian - essentials.sudo.exempt - false
[01:21:15 INFO]: [LP] VB > dalphinian - csn.command - undefined

However, looking at the code, I'm not entirely sure why this is happening? If this is a LuckPerms bug let me know and I'll move this issue to there.

Tsuser1 commented 2 years ago

Server version:

[01:27:24 INFO]: This server is running Paper version git-Paper-117 (MC: 1.18.1) (Implementing API version 1.18.1-R0.1-SNAPSHOT) (Git: 64f9225)

Plugin version (from plugin.yml in jar):

version: '1.3.3 (build 51)'

Permissions plugin in use:

[01:30:10 INFO]: [LP] Running LuckPerms v5.3.74 by Luck.
[01:30:10 INFO]: [LP] -  Platform: Bukkit
[01:30:10 INFO]: [LP] -  Server Brand: Paper
[01:30:10 INFO]: [LP] -  Server Version:
[01:30:10 INFO]: [LP]      git-Paper-117 (MC: 1.18.1) - 1.18.1-R0.1-SNAPSHOT
[01:30:10 INFO]: [LP] -  Storage:
[01:30:10 INFO]: [LP]      Type: H2
[01:30:10 INFO]: [LP]      File Size: 0.19MB
[01:30:10 INFO]: [LP] -  Extensions:
[01:30:10 INFO]: [LP]      None
[01:30:10 INFO]: [LP] -  Messaging: None
[01:30:10 INFO]: [LP] -  Instance:
[01:30:10 INFO]: [LP]      Static contexts: None
[01:30:10 INFO]: [LP]      Online Players: 4 (29 unique)
[01:30:10 INFO]: [LP]      Uptime: 2d 19h 49m
[01:30:10 INFO]: [LP]      Local Data: 4 users, 8 groups, 2 tracks
Phoenix616 commented 2 years ago

I don't think there is a bug here, that is the permission of the root /csn command as defined in the plugin.yml.

Tsuser1 commented 2 years ago

However, LuckPerms never saw a request to check csn.command.history.

Phoenix616 commented 2 years ago

Well not sure, it definitely gets called in the code. If you link the full LP verbose output webpage then I might be able to spot something.

Tsuser1 commented 2 years ago

Looking at the logs further, it appears that it will only ever call csn.command.history only if csn.command is true. This is unexpected behavior for a plugin to require two permissions for a command. My issue seems to have been the undocumented behavior of needing both csn.command and csn.command.history for players to use this. What I would've expected is for csn.command to not even be a permission, and instead have csn.command.help to control listing command help.

Additionally, I did set csn.user and it didn't work. Not sure why.

Phoenix616 commented 2 years ago

Are you sure that you have default plugin permissions enabled in LuckPerms? Because it definitely works on my server with LuckPerms without specifying additional permissions. (And it's pretty standard to have a separate permission for each level of a command, just allows the most control)