Skip to content

Commit

Permalink
Apply permission check for create accesskey button (#2822)
Browse files Browse the repository at this point in the history
  • Loading branch information
prakashsvmx authored May 22, 2023
1 parent 629dd66 commit beed489
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions portal-ui/src/screens/Console/Account/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,22 @@ const Account = () => {
disabled={userIDP}
/>
</SecureComponent>
<Button
id={"create-service-account"}
onClick={() => {
navigate(`${IAM_PAGES.ACCOUNT_ADD}`);
}}
label={`Create access key`}
icon={<AddIcon />}
variant={"callAction"}
/>
<SecureComponent
scopes={[IAM_SCOPES.ADMIN_CREATE_SERVICEACCOUNT]}
resource={CONSOLE_UI_RESOURCE}
matchAll
errorProps={{ disabled: true }}
>
<Button
id={"create-service-account"}
onClick={() => {
navigate(`${IAM_PAGES.ACCOUNT_ADD}`);
}}
label={`Create access key`}
icon={<AddIcon />}
variant={"callAction"}
/>
</SecureComponent>
</Box>
</Grid>

Expand Down

0 comments on commit beed489

Please sign in to comment.