Conversation
PM-3904 Restrict engagements tab to only admins
| { id: 1, label: 'All Work' }, | ||
| { id: 2, label: 'Projects' }, | ||
| ...(canViewEngagements ? [{ id: 3, label: 'Engagements' }] : []), | ||
| ...(isAdmin ? [{ id: 3, label: 'Engagements' }] : []), |
There was a problem hiding this comment.
[❗❗ correctness]
The change from canViewEngagements to isAdmin restricts the visibility of the 'Engagements' tab to only admin users. Ensure that this change aligns with the intended business logic, as it removes access for any other roles that might have previously been able to view this tab.
| } | ||
| if (pathname === '/engagements') { | ||
| return canViewEngagements ? 3 : 0 | ||
| return isAdmin ? 3 : 0 |
There was a problem hiding this comment.
[❗❗ correctness]
The change from canViewEngagements to isAdmin in the getTabFromPath method alters the logic for determining access to the '/engagements' path. Ensure that this change aligns with the intended access control requirements, as it now restricts access solely to admin users.
| this.props.unloadProjects() | ||
| this.setState({ currentTab: 2 }) | ||
| } else if (tab === 3 && canViewEngagements) { | ||
| } else if (tab === 3 && isAdmin) { |
There was a problem hiding this comment.
[❗❗ correctness]
The condition for navigating to the '/engagements' path has been changed to check isAdmin instead of canViewEngagements. This could potentially restrict access for users who are not admins but should have access based on previous logic. Verify that this change is intentional and aligns with the new requirements.
| )()} | ||
| /> | ||
| {canAccessEngagements && ( | ||
| {isAdmin && ( |
There was a problem hiding this comment.
[❗❗ correctness]
The change from canAccessEngagements to isAdmin may impact users who previously had access under the Talent Manager role. Ensure that this change aligns with the intended access control policy.
| /> | ||
| )} | ||
| {!canAccessEngagements && ( | ||
| {!isAdmin && ( |
There was a problem hiding this comment.
[❗❗ correctness]
Similarly, the change from !canAccessEngagements to !isAdmin restricts the warning message to only non-admin users. Verify that this behavior is consistent with the new role-based access requirements.
https://topcoder.atlassian.net/browse/PM-3904