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

Access Policies for Websocket Subscriptions #4385

Closed
rahul1 opened this issue Apr 16, 2024 · 0 comments · Fixed by #4540
Closed

Access Policies for Websocket Subscriptions #4385

rahul1 opened this issue Apr 16, 2024 · 0 comments · Fixed by #4540
Assignees
Labels
subscriptions Features and fixes related to subscriptions

Comments

@rahul1
Copy link
Member

rahul1 commented Apr 16, 2024

Problem

  • Patient user creates a websocket Subscription resource to recieve incoming chats
  • Admin would like to create an access policy to prevent Patient user from manipulating other Subscription resources
  • The following policy won't work, because Subscriptions are not added to a Patient compartment
    {
      resourceType: 'Subscription',
      criteria: 'Subscription?type=websocket&_compartment=%profile',
    }

Possible Solutions

  • Add an author search param (only to Subscriptions) to every resource that points to meta.author. Then we can restrict access as such:
    {
      resourceType: 'Subscription',
      criteria: 'Subscription?type=websocket&author=%profile',
    }
  • Add Subscriptions to the Patient compartment (we would have to handle the case of Practitioner users seperately)
  • ???
@rahul1 rahul1 added the subscriptions Features and fixes related to subscriptions label Apr 16, 2024
@rahul1 rahul1 added this to the May 31st, 2024 milestone Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subscriptions Features and fixes related to subscriptions
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants