Skip to content

Commit 9387be3

Browse files
committed
Fix permissions on subuser rows
1 parent b52fc0b commit 9387be3

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

resources/scripts/components/server/users/UserRow.tsx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,18 @@ export default ({ subuser }: Props) => {
5151
</p>
5252
<p css={tw`text-2xs text-neutral-500 uppercase`}>Permissions</p>
5353
</div>
54-
<button
55-
type={'button'}
56-
aria-label={'Edit subuser'}
57-
css={[
58-
tw`block text-sm p-2 text-neutral-500 hover:text-neutral-100 transition-colors duration-150 mx-4`,
59-
subuser.uuid === uuid ? tw`hidden` : undefined,
60-
]}
61-
onClick={() => setVisible(true)}
62-
>
63-
<FontAwesomeIcon icon={faPencilAlt}/>
64-
</button>
54+
<Can action={'user.update'}>
55+
{subuser.uuid !== uuid &&
56+
<button
57+
type={'button'}
58+
aria-label={'Edit subuser'}
59+
css={tw`block text-sm p-2 text-neutral-500 hover:text-neutral-100 transition-colors duration-150 mx-4`}
60+
onClick={() => setVisible(true)}
61+
>
62+
<FontAwesomeIcon icon={faPencilAlt}/>
63+
</button>
64+
}
65+
</Can>
6566
<Can action={'user.delete'}>
6667
<RemoveSubuserButton subuser={subuser}/>
6768
</Can>

0 commit comments

Comments
 (0)