Skip to content

Commit

Permalink
all users can edit Templates team
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak committed Sep 27, 2023
1 parent acd43c3 commit aa2a525
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion editor.planx.uk/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ const EditorToolbar: React.FC<{
<Edit />
</ListItemIcon>
<ListItemText>
{user.isPlatformAdmin ? `All teams` : user.teams.map((team) => team.team.name).join(", ")}
{user.isPlatformAdmin ? `All teams` : user.teams.map((team) => team.team.name).concat(["Templates"]).join(", ")}
</ListItemText>
</MenuItem>
)}
Expand Down
8 changes: 3 additions & 5 deletions editor.planx.uk/src/pages/FlowEditor/lib/store/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,9 @@ export const userStore: StateCreator<UserStore, [], [], UserStore> = (

canUserEditTeam: (teamSlug) => {
return (
get().teams.filter(
(team) =>
(team.role === "teamEditor" && team.team.slug === teamSlug) ||
get().isPlatformAdmin,
).length > 0
get().isPlatformAdmin ||
teamSlug === "templates" ||
get().teams.filter((team) => team.role === "teamEditor" && team.team.slug === teamSlug).length > 0
);
},
});

0 comments on commit aa2a525

Please sign in to comment.