[DONE] Groups and permissions refactor
#1
I'd like to refactor the groups and permissions system; they need to be changed anyway due to the UUID changes, so I thought we might upgrade them in the process. This thread should serve as a discussion about the changes.

Currently, groups serve a dual purpose - to give players permissions and for the message visuals. They support (multiple) inheritance to make the setup easier and to allow for logical categories. A player can be assigned to multiple groups, the first group is used as the source of the visuals.

This system is slightly unintuitive for server admins. They want to be able to "rank" players - set them in a single rank where the player receives a well-defined set of permissions and visuals. When the rank is changed, the old rank should be completely forgotten and overwritten by the new rank - a player can only have a single rank.

Therefore, it would make sense to insert a new class type into the hierarchy: A single player has a reference to a single rank, which defines the visuals for the player's messages and a set of groups; each group defines only the permissions, possibly inheriting from other groups:

cPlayer <-> Rank <-> PermissionGroups[]

This will allow us to implement a simple well-defined "rank" command, plus a clear and concise way to specify permissions for each rank.

The underlying objects should have the following structure:

Player:
- Rank (by name)

Rank:
- Name
- Message name color code
- Message prefix
- Message postfix
- List of PermissionGroups

PermissionGroup:
- List of permissions
- List of groups it inherits from

The DB tables representing these objects should have the following layout:

PlayerRank:
- PlayerUUID
- PlayerName
- RankID (links with a Rank record)

Rank:
- RankID
- Prefix, Postfix, etc.

PermissionGroup:
- GroupID
- GroupName

RankPermissionGroups:
- RankID (links with a Rank record)
- GroupID (links with a PermissionGroup record)

PermissionItem:
- GroupID (links with a PermissionGroup record)
- Permission


Additionally, the Rank and PermissionGroup objects will be managed by a cRankManager class. It will load the ranks and groups on server startup, will provide API methods for managing them, and will provide each cPlayer with the resolved rank and permissions. The storage will be most likely in a SQLite database, the data structure is no longer easy enough for simple text files, instead, a plugin (the Core?) will provide commands and webadmin UI to manipulate ranks, groups and permissions.

The final part will be implementing hooks so that ranks, groups and permissions can be provided by external plugins. This will allow plugin writers to create plugins that store the permissions in an external database, possibly sharing the DB with an external system, such as we-based eshop for the server.

Thoughts?
Reply
Thanks given by:


Messages In This Thread
[DONE] Groups and permissions refactor - by xoft - 08-03-2014, 02:40 AM
RE: Groups and permissions refactor - by bearbin - 08-03-2014, 04:46 PM
RE: Groups and permissions refactor - by xoft - 08-03-2014, 06:38 PM
RE: Groups and permissions refactor - by tonibm19 - 08-03-2014, 07:32 PM
RE: Groups and permissions refactor - by xoft - 08-03-2014, 07:37 PM
RE: Groups and permissions refactor - by tonibm19 - 08-04-2014, 02:09 AM
RE: Groups and permissions refactor - by xoft - 08-04-2014, 03:20 AM
RE: Groups and permissions refactor - by tonibm19 - 08-04-2014, 04:33 AM
RE: Groups and permissions refactor - by xoft - 08-04-2014, 06:44 PM
RE: Groups and permissions refactor - by xoft - 08-04-2014, 07:25 PM
RE: Groups and permissions refactor - by xoft - 08-04-2014, 08:51 PM
RE: Groups and permissions refactor - by xoft - 08-04-2014, 08:53 PM
RE: Groups and permissions refactor - by NiLSPACE - 08-04-2014, 09:02 PM
RE: Groups and permissions refactor - by bearbin - 08-04-2014, 09:22 PM
RE: Groups and permissions refactor - by xoft - 08-05-2014, 05:27 AM
RE: Groups and permissions refactor - by xoft - 08-05-2014, 05:28 AM
RE: Groups and permissions refactor - by tigerw - 08-05-2014, 07:39 AM
RE: Groups and permissions refactor - by xoft - 08-06-2014, 02:40 AM
RE: Groups and permissions refactor - by xoft - 08-09-2014, 04:06 AM
RE: Groups and permissions refactor - by NiLSPACE - 08-09-2014, 05:56 AM
RE: Groups and permissions refactor - by xoft - 08-09-2014, 06:31 AM
RE: Groups and permissions refactor - by xoft - 08-10-2014, 07:11 AM
RE: Groups and permissions refactor - by xoft - 08-10-2014, 07:20 AM
RE: Groups and permissions refactor - by NiLSPACE - 08-10-2014, 07:27 AM
RE: Groups and permissions refactor - by xoft - 08-12-2014, 06:51 AM
RE: Groups and permissions refactor - by NiLSPACE - 08-12-2014, 06:57 AM
RE: Groups and permissions refactor - by xoft - 08-12-2014, 07:05 AM
RE: Groups and permissions refactor - by NiLSPACE - 08-12-2014, 07:06 AM
RE: Groups and permissions refactor - by bearbin - 08-12-2014, 07:08 AM
RE: Groups and permissions refactor - by xoft - 08-12-2014, 05:43 PM
RE: Groups and permissions refactor - by bearbin - 08-12-2014, 07:36 PM
RE: Groups and permissions refactor - by xoft - 08-13-2014, 05:49 PM
RE: Groups and permissions refactor - by xoft - 08-13-2014, 06:20 PM
RE: Groups and permissions refactor - by NiLSPACE - 08-13-2014, 08:23 PM
RE: Groups and permissions refactor - by xoft - 08-13-2014, 09:10 PM
RE: Groups and permissions refactor - by NiLSPACE - 08-13-2014, 09:14 PM
RE: Groups and permissions refactor - by xoft - 08-13-2014, 09:18 PM
RE: Groups and permissions refactor - by LO1ZB - 08-13-2014, 10:46 PM
RE: Groups and permissions refactor - by NiLSPACE - 08-13-2014, 09:26 PM
RE: Groups and permissions refactor - by xoft - 08-13-2014, 11:09 PM
RE: Groups and permissions refactor - by xoft - 08-19-2014, 07:04 AM
RE: Groups and permissions refactor - by xoft - 08-21-2014, 05:08 AM
RE: Groups and permissions refactor - by tigerw - 08-21-2014, 08:05 PM
RE: Groups and permissions refactor - by xoft - 08-22-2014, 05:19 AM
RE: Groups and permissions refactor - by NiLSPACE - 08-22-2014, 05:24 AM



Users browsing this thread: 1 Guest(s)