Comparison

plugins/mod_admin_shell.lua @ 12208:3edf1a38fb15

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.
author Kim Alvefur <zash@zash.se>
date Sun, 23 Jan 2022 19:55:32 +0100
parent 12126:0d8e6646ce42
child 12209:3fe2e5da05c3
comparison
equal deleted inserted replaced
12207:65e252940337 12208:3edf1a38fb15
214 print [[s2s - Commands to manage sessions between this server and others]] 214 print [[s2s - Commands to manage sessions between this server and others]]
215 print [[http - Commands to inspect HTTP services]] -- XXX plural but there is only one so far 215 print [[http - Commands to inspect HTTP services]] -- XXX plural but there is only one so far
216 print [[module - Commands to load/reload/unload modules/plugins]] 216 print [[module - Commands to load/reload/unload modules/plugins]]
217 print [[host - Commands to activate, deactivate and list virtual hosts]] 217 print [[host - Commands to activate, deactivate and list virtual hosts]]
218 print [[user - Commands to create and delete users, and change their passwords]] 218 print [[user - Commands to create and delete users, and change their passwords]]
219 print [[roles - Show information about user roles]]
219 print [[muc - Commands to create, list and manage chat rooms]] 220 print [[muc - Commands to create, list and manage chat rooms]]
220 print [[server - Uptime, version, shutting down, etc.]] 221 print [[server - Uptime, version, shutting down, etc.]]
221 print [[port - Commands to manage ports the server is listening on]] 222 print [[port - Commands to manage ports the server is listening on]]
222 print [[dns - Commands to manage and inspect the internal DNS resolver]] 223 print [[dns - Commands to manage and inspect the internal DNS resolver]]
223 print [[xmpp - Commands for sending XMPP stanzas]] 224 print [[xmpp - Commands for sending XMPP stanzas]]
251 print [[user:create(jid, password, roles) - Create the specified user account]] 252 print [[user:create(jid, password, roles) - Create the specified user account]]
252 print [[user:password(jid, password) - Set the password for the specified user account]] 253 print [[user:password(jid, password) - Set the password for the specified user account]]
253 print [[user:roles(jid, host, roles) - Set roles for an user (see 'help roles')]] 254 print [[user:roles(jid, host, roles) - Set roles for an user (see 'help roles')]]
254 print [[user:delete(jid) - Permanently remove the specified user account]] 255 print [[user:delete(jid) - Permanently remove the specified user account]]
255 print [[user:list(hostname, pattern) - List users on the specified host, optionally filtering with a pattern]] 256 print [[user:list(hostname, pattern) - List users on the specified host, optionally filtering with a pattern]]
257 elseif section == "roles" then
258 print [[Roles may grant access or restrict users from certain operations]]
259 print [[Built-in roles are:]]
260 print [[ prosody:admin - Administrator]]
261 print [[ (empty set) - Normal user]]
262 print [[]]
263 print [[The canonical role format looks like: { ["example:role"] = true }]]
264 print [[For convenience, the following formats are also accepted:]]
265 print [["admin" - short for "prosody:admin", the normal admin status (like the admins config option)]]
266 print [["example:role" - short for {["example:role"]=true}]]
267 print [[{"example:role"} - short for {["example:role"]=true}]]
256 elseif section == "muc" then 268 elseif section == "muc" then
257 -- TODO `muc:room():foo()` commands 269 -- TODO `muc:room():foo()` commands
258 print [[muc:create(roomjid, { config }) - Create the specified MUC room with the given config]] 270 print [[muc:create(roomjid, { config }) - Create the specified MUC room with the given config]]
259 print [[muc:list(host) - List rooms on the specified MUC component]] 271 print [[muc:list(host) - List rooms on the specified MUC component]]
260 print [[muc:room(roomjid) - Create the specified MUC room with the given config]] 272 print [[muc:room(roomjid) - Create the specified MUC room with the given config]]