Merge pull request #2473 from Bilb/fix-remove-admin-remove-mod-topo

Fix remove admin remove mod permission too
pull/2479/head
Audric Ackermann 3 years ago committed by GitHub
commit 2bd6c01ee3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -240,8 +240,8 @@
"cannotRemoveCreatorFromGroup": "Cannot remove this user", "cannotRemoveCreatorFromGroup": "Cannot remove this user",
"cannotRemoveCreatorFromGroupDesc": "You cannot remove this user as they are the creator of the group.", "cannotRemoveCreatorFromGroupDesc": "You cannot remove this user as they are the creator of the group.",
"noContactsForGroup": "You don't have any contacts yet", "noContactsForGroup": "You don't have any contacts yet",
"failedToAddAsModerator": "Failed to add user as moderator", "failedToAddAsModerator": "Failed to add user as admin",
"failedToRemoveFromModerator": "Failed to remove user from the moderator list", "failedToRemoveFromModerator": "Failed to remove user from the admin list",
"copyMessage": "Copy message text", "copyMessage": "Copy message text",
"selectMessage": "Select message", "selectMessage": "Select message",
"editGroup": "Edit group", "editGroup": "Edit group",
@ -297,15 +297,15 @@
"editProfileModalTitle": "Profile", "editProfileModalTitle": "Profile",
"groupNamePlaceholder": "Group Name", "groupNamePlaceholder": "Group Name",
"inviteContacts": "Invite Contacts", "inviteContacts": "Invite Contacts",
"addModerators": "Add Moderators", "addModerators": "Add Admins",
"removeModerators": "Remove Moderators", "removeModerators": "Remove Admins",
"addAsModerator": "Add as Moderator", "addAsModerator": "Add as Admin",
"removeFromModerators": "Remove From Moderators", "removeFromModerators": "Remove From Admins",
"add": "Add", "add": "Add",
"addingContacts": "Adding contacts to $name$", "addingContacts": "Adding contacts to $name$",
"noContactsToAdd": "No contacts to add", "noContactsToAdd": "No contacts to add",
"noMembersInThisGroup": "No other members in this group", "noMembersInThisGroup": "No other members in this group",
"noModeratorsToRemove": "no moderators to remove", "noModeratorsToRemove": "no admins to remove",
"onlyAdminCanRemoveMembers": "You are not the creator", "onlyAdminCanRemoveMembers": "You are not the creator",
"onlyAdminCanRemoveMembersDesc": "Only the creator of the group can remove users", "onlyAdminCanRemoveMembersDesc": "Only the creator of the group can remove users",
"createAccount": "Create account", "createAccount": "Create account",
@ -352,8 +352,8 @@
"pickClosedGroupMember": "Please pick at least 1 group member", "pickClosedGroupMember": "Please pick at least 1 group member",
"closedGroupMaxSize": "A closed group cannot have more than 100 members", "closedGroupMaxSize": "A closed group cannot have more than 100 members",
"noBlockedContacts": "No blocked contacts", "noBlockedContacts": "No blocked contacts",
"userAddedToModerators": "User added to moderator list", "userAddedToModerators": "User added to admin list",
"userRemovedFromModerators": "User removed from moderator list", "userRemovedFromModerators": "User removed from admin list",
"orJoinOneOfThese": "Or join one of these...", "orJoinOneOfThese": "Or join one of these...",
"helpUsTranslateSession": "Help us Translate Session", "helpUsTranslateSession": "Help us Translate Session",
"translation": "Translation", "translation": "Translation",

@ -282,12 +282,15 @@ const makeBatchRequestPayload = (
method: 'POST', method: 'POST',
path: `/user/${sessionId}/moderator`, path: `/user/${sessionId}/moderator`,
// An admin has moderator permissions automatically, but removing his admin permissions only will keep him as a moderator.
// We do not want this currently. When removing an admin from Session Desktop we want to remove all his permissions server side.
// We'll need to build a complete dialog with options to make the whole admins/moderator/global/visible/hidden logic work as the server was built for.
json: { json: {
rooms: [options.addRemoveModerators.roomId], rooms: [options.addRemoveModerators.roomId],
global: false, global: false,
// moderator: isAddMod, // currently we only support adding/removing visible admins
visible: true, visible: true,
admin: isAddMod, admin: isAddMod,
moderator: isAddMod,
}, },
})); }));
case 'banUnbanUser': case 'banUnbanUser':

Loading…
Cancel
Save