Diff

plugins/adhoc/mod_adhoc.lua @ 10565:421b2f8369fd

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.
author Kim Alvefur <zash@zash.se>
date Fri, 20 Dec 2019 22:47:34 +0100
parent 10542:f1886a48a6d4
child 11209:f6661fac7e9a
line wrap: on
line diff
--- a/plugins/adhoc/mod_adhoc.lua	Tue Dec 24 00:49:43 2019 +0100
+++ b/plugins/adhoc/mod_adhoc.lua	Fri Dec 20 22:47:34 2019 +0100
@@ -26,7 +26,7 @@
 		if (command.permission == "admin" and privileged)
 		    or (command.permission == "global_admin" and global_admin)
 		    or (command.permission == "local_user" and hostname == module.host)
-		    or (command.permission == "user") then
+		    or (command.permission == "any") then
 			reply:tag("identity", { name = command.name,
 			    category = "automation", type = "command-node" }):up();
 			reply:tag("feature", { var = xmlns_cmd }):up();
@@ -57,7 +57,7 @@
 		if (command.permission == "admin" and admin)
 		    or (command.permission == "global_admin" and global_admin)
 		    or (command.permission == "local_user" and hostname == module.host)
-		    or (command.permission == "user") then
+		    or (command.permission == "any") then
 			reply:tag("item", { name = command.name,
 			    node = node, jid = module:get_host() });
 			reply:up();