diff options
author | Kim Alvefur <zash@zash.se> | 2019-12-20 22:47:34 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-12-20 22:47:34 +0100 |
commit | e09ce77c8d099e9cbb308990e68ad44859c5e62a (patch) | |
tree | 10b79de6881f3814f3064bb278f76959aa9eb9c1 /plugins/adhoc/adhoc.lib.lua | |
parent | dec1bce0debb65759b94a73783b86354538c6f59 (diff) | |
download | prosody-e09ce77c8d099e9cbb308990e68ad44859c5e62a.tar.gz prosody-e09ce77c8d099e9cbb308990e68ad44859c5e62a.zip |
mod_adhoc: Improve permission setting (fix #1482) BC
Rename 'user' permission mode to 'any' for clarity, too easily mistaken
for what the 'local_user' setting does.
It is also removed as a default and made a required argument.
Diffstat (limited to 'plugins/adhoc/adhoc.lib.lua')
-rw-r--r-- | plugins/adhoc/adhoc.lib.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/adhoc/adhoc.lib.lua b/plugins/adhoc/adhoc.lib.lua index 0b910299..0c61a636 100644 --- a/plugins/adhoc/adhoc.lib.lua +++ b/plugins/adhoc/adhoc.lib.lua @@ -21,7 +21,13 @@ local function _cmdtag(desc, status, sessionid, action) end function _M.new(name, node, handler, permission) - return { name = name, node = node, handler = handler, cmdtag = _cmdtag, permission = (permission or "user") }; + if not permission then + error "adhoc.new() expects a permission argument, none given" + end + if permission == "user" then + error "the permission mode 'user' has been renamed 'any', please update your code" + end + return { name = name, node = node, handler = handler, cmdtag = _cmdtag, permission = permission }; end function _M.handle_cmd(command, origin, stanza) |