aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/adhoc/adhoc.lib.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2022-08-22 13:53:35 +0100
committerMatthew Wild <mwild1@gmail.com>2022-08-22 13:53:35 +0100
commite4ed9a570ab61ef45ca0e63dfd6d230e26812749 (patch)
tree361af05ddf1d012f9ce849528d36cfa83a0715ba /plugins/adhoc/adhoc.lib.lua
parentb79cb49bfba1d64dda54cf7243154624c53b5fb9 (diff)
parent227f6c033697210a54f671f5b9128cde8699fdcd (diff)
downloadprosody-e4ed9a570ab61ef45ca0e63dfd6d230e26812749.tar.gz
prosody-e4ed9a570ab61ef45ca0e63dfd6d230e26812749.zip
Merge role-auth->trunk
Diffstat (limited to 'plugins/adhoc/adhoc.lib.lua')
-rw-r--r--plugins/adhoc/adhoc.lib.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/adhoc/adhoc.lib.lua b/plugins/adhoc/adhoc.lib.lua
index eb91f252..9f091e3b 100644
--- a/plugins/adhoc/adhoc.lib.lua
+++ b/plugins/adhoc/adhoc.lib.lua
@@ -23,10 +23,16 @@ end
function _M.new(name, node, handler, permission)
if not permission then
error "adhoc.new() expects a permission argument, none given"
- end
- if permission == "user" then
+ elseif permission == "user" then
error "the permission mode 'user' has been renamed 'any', please update your code"
end
+ if permission == "admin" then
+ module:default_permission("prosody:admin", "mod_adhoc:"..node);
+ permission = "check";
+ elseif permission == "global_admin" then
+ module:default_permission("prosody:operator", "mod_adhoc:"..node);
+ permission = "check";
+ end
return { name = name, node = node, handler = handler, cmdtag = _cmdtag, permission = permission };
end