IntellectualSites / IntellectualSites/PlotSquared
Odd permission checks for the flag-remove command
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 653
- Forks
- 975
- Avg merge
- 2m
- Merged PRs (30d)
- 6
Description
Server Implementation
Paper
Server Version
1.17.1
Describe the bug
The command /p flag remove <some flag> gives a no-permission message, while the command /p flag remove <some flag> test removes the flag from your plot. Moreover, even with the permission plots.set.flag.<some flag>.*, you get a no-permission message when using /p flag remove <some flag>.
To Reproduce
- Give yourself access to
plots.flag.removeandplots.set.flag.lectern-read-book.*, but not toplots.set.flag.lectern-read-book. - Set the lectern-read-book flag to true on your plot.
- Run the commands
/p flag remove lectern-read-bookand/p flag remove lectern-read-book testand observe the difference.
Expected behaviour
Permitted usage of the flag-remove command to not depend on some random second argument. I don't care if players need some permission extra to plots.flag.remove to remove a flag.
However, in case the extra permission requirement plots.set.flag.<some flag> for /plot flag remove <some flag> is kept, I would prefer it if plots.set.flag.<some flag>.* also gives access to /plot flag remove <some flag>. Just so I don't need to go through all flag permissions and grant players plots.set.flag.<some flag> in addition to plots.set.flag.<some flag>.*.
Screenshots / Videos
No response
Error log (if applicable)
No response
Plot Debugpaste
Not necessary, issue is obvious in the code.
PlotSquared Version
Built 635e18e7ed47029992ec59cf32429275d904c49c from source
Checklist
- I have included a Plot debugpaste.
- I am using the newest build from https://www.spigotmc.org/resources/77506/ and the issue still persists.
Anything else?
The cause is this code block.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the linked FlagCommand.java block at lines 462-470 and compare permission handling for /p flag remove <flag> versus the form with a second argument. Reproduce the two commands with the permissions listed in the issue. Done means flag removal no longer depends on an unrelated second argument, and the intended wildcard permission behavior is consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- authorization, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100