Merge pull request #25983 from overleaf/ii-managed-users-make-unmanaged-roles-access
[web] Prevent managers from removing/deleting themselves GitOrigin-RevId: 9287dc06bab8024bf03fecff678a4118a9456919
This commit is contained in:
@@ -201,6 +201,8 @@
|
||||
"can_view_content": "",
|
||||
"cancel": "",
|
||||
"cancel_add_on": "",
|
||||
"cancel_any_existing_subscriptions": "",
|
||||
"cancel_any_existing_subscriptions_and_leave_any_group_subscriptions": "",
|
||||
"cancel_anytime": "",
|
||||
"cancel_my_account": "",
|
||||
"cancel_my_subscription": "",
|
||||
@@ -1142,7 +1144,7 @@
|
||||
"only_group_admin_or_managers_can_delete_your_account_2": "",
|
||||
"only_group_admin_or_managers_can_delete_your_account_3": "",
|
||||
"only_group_admin_or_managers_can_delete_your_account_4": "",
|
||||
"only_group_admin_or_managers_can_delete_your_account_5": "",
|
||||
"only_group_admin_or_managers_can_delete_your_account_8": "",
|
||||
"only_importer_can_refresh": "",
|
||||
"open_action_menu": "",
|
||||
"open_advanced_reference_search": "",
|
||||
|
||||
+8
-3
@@ -60,7 +60,8 @@ export default function DropdownButton({
|
||||
|
||||
const managedUsersActive = getMeta('ol-managedUsersActive')
|
||||
const groupSSOActive = getMeta('ol-groupSSOActive')
|
||||
|
||||
const userId = getMeta('ol-user_id')
|
||||
const isUserGroupManager = getMeta('ol-isUserGroupManager')
|
||||
const userPending = user.invite
|
||||
const isGroupSSOLinked =
|
||||
!userPending && user.enrollment?.sso?.some(sso => sso.groupId === groupId)
|
||||
@@ -238,7 +239,11 @@ export default function DropdownButton({
|
||||
</MenuItemButton>
|
||||
)
|
||||
}
|
||||
if (isUserManaged && !user.isEntityAdmin) {
|
||||
if (
|
||||
isUserManaged &&
|
||||
!user.isEntityAdmin &&
|
||||
(!isUserGroupManager || userId !== user._id)
|
||||
) {
|
||||
buttons.push(
|
||||
<MenuItemButton
|
||||
key="delete-user-action"
|
||||
@@ -272,7 +277,7 @@ export default function DropdownButton({
|
||||
|
||||
if (buttons.length === 0) {
|
||||
buttons.push(
|
||||
<DropdownListItem>
|
||||
<DropdownListItem key="no-actions-available">
|
||||
<DropdownItem
|
||||
as="button"
|
||||
tabIndex={-1}
|
||||
|
||||
@@ -147,6 +147,7 @@ export interface Meta {
|
||||
'ol-isRegisteredViaGoogle': boolean
|
||||
'ol-isRestrictedTokenMember': boolean
|
||||
'ol-isSaas': boolean
|
||||
'ol-isUserGroupManager': boolean
|
||||
'ol-itm_campaign': string
|
||||
'ol-itm_content': string
|
||||
'ol-itm_referrer': string
|
||||
@@ -268,6 +269,7 @@ export interface Meta {
|
||||
'ol-users': ManagedUser[]
|
||||
'ol-usersBestSubscription': ProjectDashboardSubscription | undefined
|
||||
'ol-usersEmail': string | undefined
|
||||
'ol-usersSubscription': { personal: boolean; group: boolean }
|
||||
'ol-validationStatus': ValidationStatus
|
||||
'ol-wikiEnabled': boolean
|
||||
'ol-writefullCssUrl': string
|
||||
|
||||
Reference in New Issue
Block a user