From 49f1b4a691d502b14457105f294781f77bda66a2 Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 25 Sep 2018 10:27:17 +0200 Subject: [PATCH] Allow an occupant owner/admin to kick lower-affiliation moderator --- src/mod_muc_room.erl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index 6d92b7092..bc4b0a05b 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -3051,6 +3051,15 @@ can_change_ra(_FAffiliation, _FRole, admin, moderator, can_change_ra(admin, _FRole, _TAffiliation, moderator, role, participant, _ServiceAf) -> true; +can_change_ra(owner, moderator, TAffiliation, + moderator, role, none, _ServiceAf) + when TAffiliation /= owner -> + true; +can_change_ra(admin, moderator, TAffiliation, + moderator, role, none, _ServiceAf) + when (TAffiliation /= owner) and + (TAffiliation /= admin) -> + true; can_change_ra(_FAffiliation, _FRole, _TAffiliation, _TRole, role, _Value, _ServiceAf) -> false.