equal
deleted
inserted
replaced
53 |
53 |
54 -- Permissions |
54 -- Permissions |
55 local actor = stanza.attr.from; |
55 local actor = stanza.attr.from; |
56 local actor_nick = room:get_occupant_jid(actor); |
56 local actor_nick = room:get_occupant_jid(actor); |
57 local affiliation = room:get_affiliation(actor); |
57 local affiliation = room:get_affiliation(actor); |
|
58 -- Retrieve their current role, iff they are in the room, otherwise what they |
|
59 -- would have based on affiliation. |
58 local role = room:get_role(actor_nick) or room:get_default_role(affiliation); |
60 local role = room:get_role(actor_nick) or room:get_default_role(affiliation); |
59 if valid_roles[role or "none"] < valid_roles.moderator then |
61 if valid_roles[role or "none"] < valid_roles.moderator then |
60 origin.send(st.error_reply(stanza, "auth", "forbidden", "You need a role of at least 'moderator'")); |
62 origin.send(st.error_reply(stanza, "auth", "forbidden", "You need a role of at least 'moderator'")); |
61 return true; |
63 return true; |
62 end |
64 end |