Software /
code /
prosody
Comparison
plugins/muc/mod_muc.lua @ 13170:082c7d856e61
core, plugins: Split prosody:user role into prosody:{guest,registered,member}
This gives us more granular control over different types of user account.
Accounts registered by IBR get assigned prosody:registered by default, while
accounts provisioned by an admin (e.g. via prosodyctl shell) will receive
prosody:member by default.
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 29 Jun 2023 15:36:13 +0100 |
parent | 12977:74b9e05af71e |
child | 13209:c8d949cf6b09 |
comparison
equal
deleted
inserted
replaced
13169:7b6e7290265b | 13170:082c7d856e61 |
---|---|
412 return true; | 412 return true; |
413 end, -10); | 413 end, -10); |
414 end | 414 end |
415 | 415 |
416 local restrict_room_creation = module:get_option("restrict_room_creation"); | 416 local restrict_room_creation = module:get_option("restrict_room_creation"); |
417 module:default_permission(restrict_room_creation == true and "prosody:admin" or "prosody:user", ":create-room"); | 417 module:default_permission(restrict_room_creation == true and "prosody:admin" or "prosody:registered", ":create-room"); |
418 module:hook("muc-room-pre-create", function(event) | 418 module:hook("muc-room-pre-create", function(event) |
419 local origin, stanza = event.origin, event.stanza; | 419 local origin, stanza = event.origin, event.stanza; |
420 if restrict_room_creation ~= false and not module:may(":create-room", event) then | 420 if restrict_room_creation ~= false and not module:may(":create-room", event) then |
421 origin.send(st.error_reply(stanza, "cancel", "not-allowed", "Room creation is restricted", module.host)); | 421 origin.send(st.error_reply(stanza, "cancel", "not-allowed", "Room creation is restricted", module.host)); |
422 return true; | 422 return true; |