Skip to content

Commit a06f8e0

Browse files
authored
Merge pull request pterodactyl#2763 from AreYouRlyScared/hidedelifown
Hide delete button on own subuser if for the subuser looking at the page
2 parents 7b9a8c8 + 0ca13fc commit a06f8e0

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

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

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,23 @@ export default ({ subuser }: Props) => {
4848
</p>
4949
<p css={tw`text-2xs text-neutral-500 uppercase`}>Permissions</p>
5050
</div>
51-
<Can action={'user.update'}>
52-
{subuser.uuid !== uuid &&
53-
<button
54-
type={'button'}
55-
aria-label={'Edit subuser'}
56-
css={tw`block text-sm p-1 md:p-2 text-neutral-500 hover:text-neutral-100 transition-colors duration-150 mx-4`}
57-
onClick={() => setVisible(true)}
58-
>
59-
<FontAwesomeIcon icon={faPencilAlt}/>
60-
</button>
61-
}
62-
</Can>
63-
<Can action={'user.delete'}>
64-
<RemoveSubuserButton subuser={subuser}/>
65-
</Can>
51+
{subuser.uuid !== uuid &&
52+
<>
53+
<Can action={'user.update'}>
54+
<button
55+
type={'button'}
56+
aria-label={'Edit subuser'}
57+
css={tw`block text-sm p-1 md:p-2 text-neutral-500 hover:text-neutral-100 transition-colors duration-150 mx-4`}
58+
onClick={() => setVisible(true)}
59+
>
60+
<FontAwesomeIcon icon={faPencilAlt} />
61+
</button>
62+
</Can>
63+
<Can action={'user.delete'}>
64+
<RemoveSubuserButton subuser={subuser} />
65+
</Can>
66+
</>
67+
}
6668
</GreyRowBox>
6769
);
6870
};

0 commit comments

Comments
 (0)