Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter permissions do not work #371

Closed
amyjko opened this issue Feb 20, 2024 · 0 comments
Closed

Chapter permissions do not work #371

amyjko opened this issue Feb 20, 2024 · 0 comments
Assignees
Labels
defect Something isn't working as intended writing Related to book authoring.
Milestone

Comments

@amyjko
Copy link
Owner

amyjko commented Feb 20, 2024

Expected behavior

When someone is added as a chapter editor, they should be able to edit the chapter and save.

Actual behavior

  • Create a book
  • Create a chapter
  • Create a second account
  • Add the second account to the chapter
  • As the second account, attempt to edit the chapter. Edits do not save.

Cause

The cause of this is that our check Firebase rules for chapter editing do not correctly check chapter editing permissions. The eligible list of chapter authors is stored on the chapter object in the list of chapters on the edition document, but the rules are checking the chapter document, which only has a text. The challenge here is that there's no easy way to write a rule that checks the corresponding chapter being edited, because we'd have to get the chapter number from its ID, by scanning the edition's chapters for the corresponding ID. It may be possible, but if not, we'll have to denormalize some data to make the rule writeable.

@amyjko amyjko added defect Something isn't working as intended writing Related to book authoring. labels Feb 20, 2024
@amyjko amyjko added this to the 1.0 milestone Feb 20, 2024
@amyjko amyjko self-assigned this Feb 20, 2024
@amyjko amyjko closed this as completed in 245a622 Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Something isn't working as intended writing Related to book authoring.
Projects
None yet
Development

No branches or pull requests

1 participant