Skip to content

Convert policy authZ from being based on a user to a user on a visit #1616

Description

@ZohebShaikh

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

Activity

  1. changed the title [-]Convert policy authorization from being based on a user to a user on a visit[/-] [+]Convert policy authZ from being based on a user to a user on a visit[/+] on Aug 7, 2026
  2. DominicOram commented on Aug 7, 2026

    @DominicOram
    Contributor

    Just to add reasoning for posterity:

    For most in-person visits experiments are performed by a team of a few users on site. The team are likely to run in some kind of shift pattern e.g. one person will look after the experiment whilst another goes to sleep/dinner. For long running experiments you can get into the situation where someone runs something, goes off to dinner and the person left realises that actually the running experiment is incorrect and wants to stop it.

  3. DominicOram commented on Sep 22, 2026

    @DominicOram
    Contributor

    For i15-1 we're using the fact that a session is not 100% required to allow for the stop all case even if the user is logged in without a session. It shouldn't really be possible for a user to be able to log in without a session but we don't want to bet the safety of a detector on it. This means it would be good to have some solution for #1681 (or at least a discussion) before this is implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions