Skip to content

Commit

Permalink
fix: Add permission guard to "Add a new Editor" button (#3786)
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr authored Oct 10, 2024
1 parent ef1855a commit 835afc6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,17 +194,19 @@ export const MembersTable = ({
</StyledTableRow>
))}
{showAddMemberButton && (
<TableRow>
<TableCell colSpan={5}>
<AddButton
onClick={() => {
addUser();
}}
>
Add a new editor
</AddButton>
</TableCell>
</TableRow>
<Permission.IsPlatformAdmin>
<TableRow>
<TableCell colSpan={5}>
<AddButton
onClick={() => {
addUser();
}}
>
Add a new editor
</AddButton>
</TableCell>
</TableRow>
</Permission.IsPlatformAdmin>
)}
</TableBody>
</Table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ describe("when a user is not a platform admin", () => {
useStore.setState({
teamMembers: mockTeamMembersData,
user: mockPlainUser,
teamSlug: "templates",
teamSlug: "trumptonshire",
});
});

Expand Down

0 comments on commit 835afc6

Please sign in to comment.