From 1809c0460f51547c5ee26f37c426cc65352bb886 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 23 Jan 2022 19:55:32 +0100 Subject: mod_admin_shell: Add help section about roles As in the argument to user:create() and user:roles() Tricky to come up with something sensible to write when Prosody core only knows of the 'prosody:admin' role so far. --- plugins/mod_admin_shell.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'plugins/mod_admin_shell.lua') diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua index 1f860370..01fef416 100644 --- a/plugins/mod_admin_shell.lua +++ b/plugins/mod_admin_shell.lua @@ -216,6 +216,7 @@ function commands.help(session, data) print [[module - Commands to load/reload/unload modules/plugins]] print [[host - Commands to activate, deactivate and list virtual hosts]] print [[user - Commands to create and delete users, and change their passwords]] + print [[roles - Show information about user roles]] print [[muc - Commands to create, list and manage chat rooms]] print [[server - Uptime, version, shutting down, etc.]] print [[port - Commands to manage ports the server is listening on]] @@ -253,6 +254,17 @@ function commands.help(session, data) print [[user:roles(jid, host, roles) - Set roles for an user (see 'help roles')]] print [[user:delete(jid) - Permanently remove the specified user account]] print [[user:list(hostname, pattern) - List users on the specified host, optionally filtering with a pattern]] + elseif section == "roles" then + print [[Roles may grant access or restrict users from certain operations]] + print [[Built-in roles are:]] + print [[ prosody:admin - Administrator]] + print [[ (empty set) - Normal user]] + print [[]] + print [[The canonical role format looks like: { ["example:role"] = true }]] + print [[For convenience, the following formats are also accepted:]] + print [["admin" - short for "prosody:admin", the normal admin status (like the admins config option)]] + print [["example:role" - short for {["example:role"]=true}]] + print [[{"example:role"} - short for {["example:role"]=true}]] elseif section == "muc" then -- TODO `muc:room():foo()` commands print [[muc:create(roomjid, { config }) - Create the specified MUC room with the given config]] -- cgit v1.2.3