aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/muc/persistent.lib.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/muc/persistent.lib.lua b/plugins/muc/persistent.lib.lua
index fc0f16db..4c753921 100644
--- a/plugins/muc/persistent.lib.lua
+++ b/plugins/muc/persistent.lib.lua
@@ -8,7 +8,10 @@
--
local restrict_persistent = not module:get_option_boolean("muc_room_allow_persistent", true);
-module:default_permission("prosody:admin", ":create-persistent-room"); -- Admins can always create, by default
+module:default_permission(
+ restrict_persistent and "prosody:admin" or "prosody:user",
+ ":create-persistent-room"
+);
local function get_persistent(room)
return room._data.persistent;
@@ -22,7 +25,7 @@ local function set_persistent(room, persistent)
end
module:hook("muc-config-form", function(event)
- if restrict_persistent and not module:may(":create-persistent-room", event.actor) then
+ if not module:may(":create-persistent-room", event.actor) then
-- Hide config option if this user is not allowed to create persistent rooms
return;
end
@@ -36,7 +39,7 @@ module:hook("muc-config-form", function(event)
end, 100-5);
module:hook("muc-config-submitted/muc#roomconfig_persistentroom", function(event)
- if restrict_persistent and not module:may(":create-persistent-room", event.actor) then
+ if not module:may(":create-persistent-room", event.actor) then
return; -- Not allowed
end
if set_persistent(event.room, event.value) then