mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-22 13:11:55 +00:00
fix role check
This commit is contained in:
1 parent
f682ba107d
commit
64909eeeff
2 files changed
+35
-1
No files matched your search
@@ -3238,7 +3238,9 @@ processAgentMessageConn cxt user@User {userId} corrId agentConnId agentMessage =
|
||||
-- applyMember writes the change (role, or role + pinned key for a freshly TOFU-created member);
|
||||
-- the delivery scope (relay forwarding) is computed on the pre-change role
|
||||
changeMemberRole gInfo' member@GroupMember {memberRole = fromRole} applyMember gEvent
|
||||
| senderRole < GRAdmin || senderRole < fromRole =
|
||||
| senderRole < GRAdmin
|
||||
|| senderRole < fromRole
|
||||
|| senderRole < memRole =
|
||||
messageError "x.grp.mem.role with insufficient member permissions" $> Nothing
|
||||
| useRelays' gInfo && (isRosterRole memRole || isRosterRole fromRole) && senderRole /= GROwner =
|
||||
messageError "x.grp.mem.role: only the owner can change member, moderator and admin roles in relay groups" $> Nothing
|
||||
|
||||
Reference in new issue
Block a user