Apply permission check for create accesskey button (#2822)

This commit is contained in:
Prakash Senthil Vel
2023-05-22 21:56:31 +05:30
committed by GitHub
parent 629dd669c4
commit beed4895c1

View File

@@ -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>