Open jcvl92 opened 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).
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.
Have each command class extend either AdminCommand, ModCommand, or PlayerCommand. Permissions can be hardcoded in each class type.
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.
The hardcoding thing sucks, plus it can't be easily packaged with the plugin.