MUC: Prevent admins from being given affiliatons other than owner
authorKim Alvefur <zash@zash.se>
Thu, 25 Jun 2015 15:58:24 +0000 (17:58 +0200)
committerKim Alvefur <zash@zash.se>
Thu, 25 Jun 2015 15:58:24 +0000 (17:58 +0200)
plugins/muc/mod_muc.lua

index 6e86ab730d0451c6369995edc1ecee78543f8619..acc2da0d7c040beb1c66ec3b7aa2c11ba3aa4c3e 100644 (file)
@@ -51,7 +51,7 @@ function muclib.room_mt:get_affiliation(jid)
        return _get_affiliation(self, jid);
 end
 function muclib.room_mt:set_affiliation(actor, jid, affiliation, callback, reason)
-       if is_admin(jid) then return nil, "modify", "not-acceptable"; end
+       if affiliation ~= "owner" and is_admin(jid) then return nil, "modify", "not-acceptable"; end
        return _set_affiliation(self, actor, jid, affiliation, callback, reason);
 end