empowerhack / DrawMyLife-Service

API and Admin system for the Draw My Life initiative - Volunteers: check README and GitHub Projects to get started.
https://github.com/empowerhack/DrawMyLife-Service/projects
MIT License
13 stars 0 forks source link

[#149] Restrict access to drawings and organisations #153

Closed krissy closed 7 years ago

krissy commented 7 years ago

This updates the permissions around viewing, editing or deleting drawings, restricting access to Super Admins OR those within the same organisation.

It also restricts viewing, editing or deleting Organisations to Super Admins only.

NB: At this time, all of the urgent role permissions we need for a next pilot involving a second organisation are implemented. However, the Org Admin level is still exactly the same as a normal admin, so there is still a separate ticket (TODO write up) / task left to adjust Org Admin levels to allow them to access and create users - but only in their organisation. Super Admins will need to add new users in the meantime.

Addresses issue: #149

What this does

Screenshots

Super admin (access to all drawings and orgs):

screen shot 2017-03-05 at 23 45 01 screen shot 2017-03-06 at 00 08 19

Admin or Org admin (access to all drawings within org + no access to edit orgs):

screen shot 2017-03-05 at 23 44 19 screen shot 2017-03-06 at 00 08 27

Attempt to view an unauthorized drawing by accessing URL directly:

screen shot 2017-03-05 at 23 45 49

Attempt to edit/delete an unauthorized drawing by accessing URL directly:

screen shot 2017-03-05 at 23 46 35

Attempt to access/edit organisations when unauthorized

screen shot 2017-03-06 at 00 13 15
CathMollie commented 7 years ago

All worked for me. As an Admin user, I: