opensafely-core / opensafely-core/opencodelists

Access control brain dump

Open
#211 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
60
Forks
16
Avg merge
4d 12h
Merged PRs (30d)
17

Description

Currently:

  • a Codelist belongs to a Project
  • a Project belongs to one or more Organisations
  • a User belongs to an Organisation (but should be allowed to belong to more than one)

In theory this allows access control based on organisation, and lets us have different versions of similar codelists in different projects (avoiding contested definitions).

Currently, there is no access control, and new users are added by global admins.

It would be good to have:

  • creation of new users via web page
  • email notification, with link to password form, when new user added
  • a password reset buttong

but this is not urgent.

Once we have collaborators working on different projects, we should at a minimum:

  • restrict adding/editing codelists to members of organisations that the codelists' project belongs to
  • allow members of an organisation to invite new members to the organisation
  • allow codelists to belong directly to a user

But we can leave creating organisations and projects to global admins.

Longer term, we may want:

  • different classes of user
    • organisation admins can add members to the organisation
    • organisation admins can request to join projects
    • project admins can accept requests from projects
  • per-codelist permissions
    • so only certain users can update a codelist

Authentication is orthogonal and I don't have any strong opinions. I have a slight preference for doing it all in Django -- it's not that hard, and I think gives a nicer user experience than using eg GitHub for SSO.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests and combines several access-control and authentication proposals. Start by reviewing the existing Django user, organisation, project, and codelist models and web entry points, then turn the requirements into a scoped decision. Done should mean an agreed, testable first phase rather than implementing the full list.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
authentication, authorization, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.