1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-09 00:18:00 +01:00

fix: cr permission actions (#2574)

Fixes an issue where `PermissionSwitch` would not update because we
passed in environmentId and the UPDATE_PROJECT permission is only
project specific. Also fixes an issue where hasAccess didn't take in
projectId for UPDATE_PROJECT which is a project specific permission.
This commit is contained in:
Fredrik Strand Oseberg 2022-11-30 14:45:23 +01:00 committed by GitHub
parent 5c74efc6c6
commit 4bc2c747b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -161,7 +161,12 @@ export const ChangeRequestConfiguration: VFC = () => {
approvals
);
}}
disabled={!hasAccess(UPDATE_PROJECT)}
disabled={
!hasAccess(
UPDATE_PROJECT,
projectId
)
}
IconComponent={
KeyboardArrowDownOutlined
}
@ -186,7 +191,6 @@ export const ChangeRequestConfiguration: VFC = () => {
<StyledBox data-loading>
<PermissionSwitch
checked={value}
environmentId={original.environment}
projectId={projectId}
permission={UPDATE_PROJECT}
inputProps={{ 'aria-label': original.environment }}