This is a bit (more like a kilobyte) of an add on to Miwarre's suggestion to add some functions to the API to retrieve the group names or group the player is in. This is fine but I'd like to also see a way to add custom values to the permissions. I know we can add custom attributes already can be added to the Player table but that's very 2-dimmensional. I'd like to see the ability to add more complex data in a format that's admin friendly to read.
The following you can pass a string in with the name of the group you are interested in and optionally a node. Now I'm not sure how to represent the node or what kind of returned data structure these should yield. I like working with JSON but I'm more of a Python guy so I'm not sure how easy it is to manipulate a JSON object in Java. Perhaps the return should be a multi-dimensional array. I don't know but here are the functions I'd like to see:
Server.getPermissionDetails(GroupName,Node) #Specify the group name and optionally a node. If Node is not specified then the return is a data structure representing the entire yaml file
Player.getPermissionDetails(Node) #Obviously Group name is not needed. It just returns the effective permissions from the specified node)
Player.getCustomPermissionDetails(Node) #same as above but the root node defaults to Custom
Here's an example using what I see the potential to be to centrally store custom settings. These settings and values are arbitrary and not based on any known plugin/script functionality
so if I wanted to grab a custom setting, we give the parent node and the function returns a JSON (I'm partial to json structures but it could be any other structure that makes sense in Java such as nested arrays(.
Server.getPermissionDetails("Settler","Custom/AreaProtection")
this would return something structured like { "GlobalRole": "Settler", "Allowed": { "OpenOthersDoors"}, "Deny" : {"EditAreaWithoutBeingAdded", "OpenOthersChests", "GriefWithTNT"} } (again, this is a JSON example because that's what I'm familiar with)
or something more specific:
Player.getCustomPermissionDetails("Guestbook")
Returns a structure like { "Allow" : { "LeavePublicComent" }, "Deny" : { "LeaveEmailAddress" } }
Player.getCustomPermissionDetails("Guestbook/Allow")
this returns something like { "LeavePublicComment"}