terrarium-earth / Cadmus

A land claiming mod that allows users to claim land to protect your home from thieves, bandits and monsters, and admins to claim land with region flags and advanced protection!
MIT License
21 stars 8 forks source link

[Bug]: /claim settings is tied to same Prometheus permissions as bypassing claims. #26

Closed bconlon1 closed 6 months ago

bconlon1 commented 10 months ago

Bug Description

Players are unable to use /claim settings to modify the settings of their personal claims as stated by the Cadmus documentation. After doing some digging into the code, I believe this is because the commands are coded to use the same permissions.

For example, for the canBreak setting in commands, it uses the BLOCK_BREAKING permission: https://github.com/terrarium-earth/Cadmus/blob/92466a96c0fe695de919d024731f1b730e5b5591/common/src/main/java/earth/terrarium/cadmus/common/commands/claims/ClaimSettingsCommand.java#L55

Which also happens to be the permission for whether a player can break blocks in a claim: https://github.com/terrarium-earth/Cadmus/blob/92466a96c0fe695de919d024731f1b730e5b5591/common/src/main/java/earth/terrarium/cadmus/common/claims/ClaimApiImpl.java#L53

This means that a player can only set a claim setting if they have permission to access all claims.

How to Reproduce?

  1. Ensure you do not have a Prometheus role with any cadmus permissions.
  2. Attempt to modify a setting using /claim settings.
  3. Notice that you get the "You are not allowed to manage this setting." message.

Expected Behavior

I would have expected players to be able to edit their claim settings, as mentioned in the documentation.

Version

1.0.2

Mod Loader Version

1.20.1 - 47.1.0

Mod Loader

Forge

Logs or additional context

No response

Code of Conduct