Skip to content

Commit

Permalink
Allow chapter editors to edit references.
Browse files Browse the repository at this point in the history
  • Loading branch information
amyjko committed Mar 3, 2024
1 parent 4adfb52 commit 0a53feb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
## Enhancement

- Added link to link editor in the toolbar to simplify link testing.
- Allow chapter editors to edit references.

## Fixed

Expand Down
2 changes: 1 addition & 1 deletion firestore.rules
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ service cloud.firestore {
}

function editionIsEditable(editionDoc) {
return request.auth != null && request.auth.uid in editionDoc.uids || bookIsEditable(getBook())
return request.auth != null && (request.auth.uid in editionDoc.uids || bookIsEditable(getBook()))
}

// Editions can be read if they are published or the user has permissions to edit the edition or book.
Expand Down
4 changes: 3 additions & 1 deletion src/lib/components/page/Contexts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ export function isEditionEditable(): boolean {
book !== undefined &&
auth !== undefined &&
auth.user !== null &&
(edition.isEditor(auth.user.uid) || book.isEditor(auth.user.uid))
(edition.isEditor(auth.user.uid) ||
book.isEditor(auth.user.uid) ||
edition.isChapterEditor(auth.user.uid))
);
}

Expand Down

0 comments on commit 0a53feb

Please sign in to comment.