Skip to content

Commit

Permalink
Fix [Project settings] 'Members' tab not shown for groups with admin …
Browse files Browse the repository at this point in the history
…privileges `1.6.x` (#2343)
  • Loading branch information
Taras-Hlukhovetskyi committed Mar 25, 2024
1 parent bad349e commit bcf2cb1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/ProjectSettings/projectSettings.util.js
Expand Up @@ -29,6 +29,7 @@ import {
PROJECTS_SETTINGS_SECRETS_TAB,
OWNER_ROLE,
USER_ROLE,
USER_GROUP_ROLE,
ADMIN_ROLE
} from '../../constants'

Expand Down Expand Up @@ -152,7 +153,11 @@ export const isProjectMembersTabShown = (
const userIsProjectSecurityAdmin =
activeUser.attributes?.assigned_policies?.includes('Project Security Admin') ?? false
const userIsAdmin = members.some(
member => member.role === ADMIN_ROLE && member.id === activeUser.id
member =>
member.role === ADMIN_ROLE &&
(member.id === activeUser.id ||
(member.type === USER_GROUP_ROLE &&
activeUser.relationships?.user_groups?.data?.some?.(group => group.id === member.id)))
)
const userIsOwner = activeUser.id === projectInfo.owner.id

Expand Down
1 change: 1 addition & 0 deletions src/constants.js
Expand Up @@ -605,4 +605,5 @@ export const ALL_ROLES = 'All'
export const EDITOR_ROLE = 'Editor'
export const OWNER_ROLE = 'Owner'
export const USER_ROLE = 'user'
export const USER_GROUP_ROLE = 'user_group'
export const VIEWER_ROLE = 'Viewer'

0 comments on commit bcf2cb1

Please sign in to comment.