DiamondLightSource / DiamondLightSource/blueapi
Convert policy authZ from being based on a user to a user on a visit
- Dominant language
- Python
- Stars
- 13
- Forks
- 13
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 25
Description
These are the current policies
Admin
1. Can create any task with a valid istrument_session
2. Can see all tasks
3. Can delete any tasks
4. Can start any task
5. Can abort any task
Users:
1. Can create any task with a instrument_session they are on
2. Can see tasks created by them
3. Can delete tasks created by them
4. Can start task created by them
5. Can abort task created by them
the policy change that @DominicOram and @EmsArnold suggested is
the policy for admin remains the same but for the users it will change as follows.
Users:
1. Can create any task with a instrument_session they are on
2. Can see tasks with a instrument_session they are on
3. Can delete tasks with a instrument_session they are on
4. Can start task with a instrument_session they are on
5. Can abort task with a instrument_session they are on
## Acceptance Criteria
- OPA policies are tweaked according to the request
Contributor guide
Research direction
No policy files or tests are named. Start by locating the OPA policy definitions and existing authorization tests, then compare the current user-based rules with instrument_session membership; done means the admin rules remain unchanged and each user action follows the stated session-based criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- authorization, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100