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

Feature/source permissions #164

Open
wants to merge 22 commits into
base: develop
Choose a base branch
from
Open

Conversation

lukavdplas
Copy link
Contributor

Changes permissions for contributors to be based on groups (close #160)

  • Adds a ContributorGroup model to track cohorts of contributors. (As discussed, I did not use Django's Group model here because managing student assistants and being able edit admin site permissions should be different privileges.) Each group has access to its own set of source texts.
  • The is_contributor boolean field is removed: users are contributors if they are added to a contributor group.
  • Mutations related to a source text now require that the user is a member of an appropriate contributor group. If not, the mutation request will be rejected.
  • Some queries now have an optional parameter editable to view only data you have permission to edit. This is now applied in the Data entry page, so users only see the sources they can edit.

The checks for mutations are not very DRY and create a lot of bulk in the code. Perhaps I'll still look for some abstraction there.

@lukavdplas lukavdplas marked this pull request as ready for review February 19, 2025 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Groups / permissions for sources
1 participant