QuiltServerTools / HeyThatsMine

MIT License
12 stars 13 forks source link

Protection Groups - One Group to Manage Them All #45

Open Foxtrek64 opened 6 months ago

Foxtrek64 commented 6 months ago

TL;DR with Scenario: I have a city where I have a lot of protections on doors, chests, etc.. If someone joins or leaves this city, I must manually update every single protected door and chest. This is further complicated when I subdivide this into groups of people. The ability to create groups of users and to have protections use that group means only one thing needs to be updated to manage all of those protections. This suggestion is to add this Protection Group feature.

Long Version: As it stands with HTM and other protection mods, if I have doors that will only be accessible by group 1, then I must get a list of everyone in that group and then manually go to each door/chest and add each person, one by one. Should that person leave group 1, then I must go to every protected block and manually update that protection to remove them. This can be a very tedious process when there are a large number of protected blocks.

So what I would like to propose is to add the ability to make groups a native feature of HTM. I can define groups, e.g. "royals", "guards", and "civilians", then grant appropriate permissions to those groups on those protections. Then if someone leaves the town guard, I can remove them from the group. When they interact with that protected block, it tests all explicit permissions (individuals added to the protection) followed by a check to see whether they are a member of a group that has been granted permission, and then allows the action or cancels it appropriately.

This also means that if I were to hire a replacement guard, I have to execute a single command to add them to the guards group and now they have access to all of the guard doors and guard chests. I don't have to run around and update every protection manually.

Bonus features (stretch goals):

Other Thoughts: We could have two backing stores for these groups:

While LuckPerms provides a stable, robust group management system, I don't believe it would be appropriate due to the clutter and lack of organization. Server admins would need to manage an individual player's groups along side the server groups. Even with a particular naming scheme, this adds a lot of objects most admins simply don't care about. With the lack of any sort of organizational structure within LP, I feel this just makes things more difficult for server managers with very few added benefits.

For servers where regions are solely managed by server staff, I can see a scenario where they might have a guard group within LuckPerms and wish to add users to that group to give the players access to guard doors. This is satisfied with the first stretch goal. The protection owner would create a guard group and the server admin would create a similar group in LP. The protection owner can then add the LP group as a member of the HTM group. This means that everyone in the LP group would inherit permissions to those protections, meaning they only need to manage a single group. And as a benefit, overall setup is not tedious and we don't have to write hooks to let non-admins create and manage LP groups, which could introduce a security risk.