Skip to content

Commit

Permalink
feat: restrict service accounts from global access roles
Browse files Browse the repository at this point in the history
  • Loading branch information
rohan-chaturvedi committed Nov 4, 2024
1 parent 445e19d commit 1c37150
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ export const CreateServiceAccountDialog = () => {
const [thirdParty, setThirdParty] = useState(false)
const [createPending, setCreatePending] = useState(false)

const roleOptions = roleData?.roles.filter((option: RoleType) => option.name !== 'Owner') || []
const roleOptions =
roleData?.roles.filter(
(option: RoleType) => option.name !== 'Owner' && option.name !== 'Admin'
) || []

useEffect(() => {
if (roleData?.roles) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ export const ServiceAccountRoleSelector = (props: { account: ServiceAccountType
})
}

const roleOptions = roleData?.roles.filter((option: RoleType) => option.name !== 'Owner') || []
const roleOptions =
roleData?.roles.filter(
(option: RoleType) => option.name !== 'Owner' && option.name !== 'Admin'
) || []

const disabled = isOwner || !userCanUpdateAccountRoles

Expand Down

0 comments on commit 1c37150

Please sign in to comment.