openlibhums / openlibhums/janeway
Implement a role hierarchy
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 238
- Forks
- 97
- Avg merge
- 9d 1h
- Merged PRs (30d)
- 8
Description
Is your feature request related to a problem? Please describe.
Janeway implements a role system that currently has some implicit hierarchies:
- Level 1. Django's own account attributes
is_staffandis_superuser. These roles are set at the installation level and there are explicit checks across views and templates. - Level 2. Editor: A journal-level role that allows users to manage most of the journal settings and, more importantly, user accounts and their roles in the journal.
- level 3. Other roles: The remaining roles grant users access to different parts of the editorial workflow but no management capabilities.
In v1.5.1, we introduced a configurable Journal Manager role that is intended to take over some of the powers from the editor role in installations where editors are not expected to manage the journal settings (or not all of them). By default, the journal manager has control over user accounts (same as the editor) and thus both are able to assign either role to any user.
Describe the solution you'd like
- As the Janeway system, I have access to a role hierarchy that allows me to validate if a role-assignment request is valid. (e.g.: If a request to assign the journal manager is received from an editor, I can check where the
editorrole sits in the role-tree relative to thejournal-managerrole and grant/deny the request) - As an editor, when I'm using role assignment interfaces, I don't get the option to assign journal manager roles.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by tracing the existing role-assignment interfaces and the explicit role checks described in the issue; define how the editor and journal-manager roles relate in the hierarchy. Done means assignment requests are validated against that hierarchy and editors no longer see the journal-manager option.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- authorization, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100