lithin9 / Unturned-Custom-Plugin

Other
0 stars 0 forks source link

Figure out a better solution to permissions configuration #28

Open jcvl92 opened 9 years ago

jcvl92 commented 9 years ago

The hardcoding thing sucks, plus it can't be easily packaged with the plugin.

jcvl92 commented 9 years ago

I don't think there is much that can be done here. Maybe we can use a wildcard or something? But, the point of the config file is so that admins can explicitly control access to plugins(maybe they only want to enable it for VIPs).

jcvl92 commented 9 years ago

Perhaps the permissions can be edited in the code though. This will have to be done for toggling permissions on/off anyway, and when config file loading is implemented there can be a flag set to either use permissions file, or to just have all functions open to every user.

jcvl92 commented 9 years ago

Have each command class extend either AdminCommand, ModCommand, or PlayerCommand. Permissions can be hardcoded in each class type.

jcvl92 commented 9 years ago

New design: All commands should extend DGCommand, which will standardize the structure of Commands and provide a permission handler(check if admin->mod->normal user, based on lowest permission level granted). Permissions groups will be set via an Enum variable.