-
Notifications
You must be signed in to change notification settings - Fork 35
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
Allow GOV.UK Admins to manage their permissions in their account page #2355
Allow GOV.UK Admins to manage their permissions in their account page #2355
Conversation
8a2897d
to
f210537
Compare
de12cf6
to
267beca
Compare
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.
Overall this looks great to me - good work! 🎉
I've added quite a few minor/subjective comments which I'm happy for you to address or not as you see fit.
I think the only one that should block merging is what I think are a couple of copy/paste errors in test/policies/account_applications_policy_test.rb
for the show?
method.
Thanks for reviewing, @floehopper 👍 I'm working through your comments now. |
c1d2887
to
a370877
Compare
f44b8d3
to
8cec3ff
Compare
This adds a "Grant access" button next to each app in the list of "Apps you don't have access to" on /account/applications. This page is currently only available to GOV.UK Admins and this functionality replicates what they're already able to do on their /users/<id>/edit page. I experimented with using the button component for the "Grant access" button but couldn't work out how to pass the visually hidden span into it. I considered using a more generic `PermissionsController` (instead of `SigninPermissionsController`) given that the signin permission is modelled the same as all other permissions, and that we're going to allow users to manage other permissions in future. I decided against it for now because the signin permission feels conceptually different to the other permissions. We can revisit this decision in future if it turns out there's a better approach.
Although not strictly necessary I've chosen to add a route for `/account/applications/<id>` so that we have hackable URLs. This route currently redirects to `/account/applications` but we might want to present something at this location in future.
8990e8c
to
99a3927
Compare
Users are required to confirm the removal of access to avoid the problem that exists in the current `/users/<id>/edit` page where Publishing Managers can accidentally remove their access to an application but then have to open a support request to get that access back again. NOTE. The functionality in this PR is currently restricted to GOV.UK Admins but will be made available to Publishing Managers soon. I experimented with using the button component for the "Remove access" button but couldn't work out how to pass the visually hidden span into it.
In preparation for using this helper in the /account pages. There's nothing specific to batch invitations in this method and moving it won't break any existing functionality because we currently include all helpers into every view.
This adds the `/account/applications/<id>/permissions` page which lists all app permissions and whether the current user has that permission or not. This new page is currently only accessible to GOV.UK Admins that have the signin permission to the app. The list of permissions has "signin" first, followed by: - other permissions the user has been granted; ordered alphabetically - other permissions the user has not been granted; ordered alphabetically
99a3927
to
32826fe
Compare
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.
This all looks good to me - well done for powering through! 😄
Thanks, @floehopper! |
https://trello.com/c/7Hfe7eu0
This PR adds functionality that allows GOV.UK Admins (users with role of "superadmin" or "admin") to manage their access to applications and to view their permissions for those applications that they have access to.
Routes added
/account/applications/<id>
/account/applications/<id>/permissions
/account/applications/<id>/signin_permission
/account/applications/<id>/signin_permission/delete
Screenshots
/account/applications
/account/applications/<id>/signin_permission/delete
/account/applications/<id>/permissions