Merge pull request #2763 from AreYouRlyScared/hidedelifown

Hide delete button on own subuser if for the subuser looking at the page
This commit is contained in:
Dane Everitt 2020-12-06 11:30:40 -08:00 committed by GitHub
commit a06f8e0d21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,8 +48,9 @@ export default ({ subuser }: Props) => {
</p>
<p css={tw`text-2xs text-neutral-500 uppercase`}>Permissions</p>
</div>
<Can action={'user.update'}>
{subuser.uuid !== uuid &&
<>
<Can action={'user.update'}>
<button
type={'button'}
aria-label={'Edit subuser'}
@ -58,11 +59,12 @@ export default ({ subuser }: Props) => {
>
<FontAwesomeIcon icon={faPencilAlt} />
</button>
}
</Can>
<Can action={'user.delete'}>
<RemoveSubuserButton subuser={subuser} />
</Can>
</>
}
</GreyRowBox>
);
};