-
Notifications
You must be signed in to change notification settings - Fork 0
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
[#149] Restrict access to drawings and organisations #153
Conversation
… only in their own organisation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm right in my thinking on that comment, tested it out myself and still works as a private method.
@@ -2,4 +2,11 @@ class ApplicationController < ActionController::Base | |||
# Prevent CSRF attacks by raising an exception. | |||
# For APIs, you may want to use :null_session instead. | |||
protect_from_forgery with: :exception | |||
|
|||
def authorize_super_admin! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be a private method as per https://github.com/empowerhack/DrawMyLife-Service/pull/153/files#diff-b49f873ae722d049d381a3fed3b3b5c5L61
All worked for me. As an Admin user, I:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice PR 👍 👯
…s-to-org [#149] Restrict access to drawings and organisations
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):
Admin or Org admin (access to all drawings within org + no access to edit orgs):
Attempt to view an unauthorized drawing by accessing URL directly:
Attempt to edit/delete an unauthorized drawing by accessing URL directly:
Attempt to access/edit organisations when unauthorized