Core
Core copied to clipboard
Add console commands to manipulate ranks / groups / permissions
We should have a full set of commands to manipulate ranks, groups and permissions so that people don't need to use webadmin to edit ranks.
Proposed commands:
addrank <rankname>
delrank <rankname> [<replacementrankname>]
renamerank <oldname> <newname>
addgroup <groupname>
delgroup <groupname>
renamegroup <oldname> <newname>
addpermission <groupname> <permission>
delpermission <groupname> <permission>
addrankgroup <rankname> <groupname>
delrankgroup <rankname> <groupname>
listranks
listgroups <rankname>
listpermissions <groupname>
listrankpermissions <rankname>
Marking as easy since most of these map directly to API calls, so the command handlers should be pretty easy to write.
Best place for the handlers would be the ranks.lua
file; don't forget to use the Info.lua
file to register and document them.
I'll try to do that. EDIT: Didn't remember now ranks and groups are managed with SQLite. Sorry :(
They are in SQLite, but the API provides a full set of commands to work with them, so it should be a simple task of mapping the console commands to API calls. Have a look at how the webadmin management does it.
Now I see, I may try later.
Why not create one permission command instead of many commands?
Example: /perms group AllPerms create /perms group AllPerms add * /perms rank Admin create /perms rank Admin addgroup AllPerms /perms rank Admin prefix "&b" /perms user Howaner setgroup Admin
I'm not against a single command, but I strongly suggest having simple separate commands as well, because almost anyone using the server will need to use those and we want to keep it as simple as possible for the regular people. No-one wants to read a big hunk of text in order to be able to play on a home server.
I think one command with the same usage format as PermissionsEx (The most used bukkit permission plugin) is much clearer and simpler than 20+ commands.