From 4bc2c747b1cf082f45a7d71b959b902d81f1d00c Mon Sep 17 00:00:00 2001 From: Fredrik Strand Oseberg Date: Wed, 30 Nov 2022 14:45:23 +0100 Subject: [PATCH] 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. --- .../ChangeRequestConfiguration.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestConfiguration.tsx b/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestConfiguration.tsx index a3b249da28..89116d84c1 100644 --- a/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestConfiguration.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestConfiguration.tsx @@ -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 = () => {