-
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 Publishing Managers to manage their apps #2370
Allow Publishing Managers to manage their apps #2370
Commits on Sep 28, 2023
-
Use redirect_back_or_to in user_not_authorized
If the user attempts to do something they're not authorized to do then we should first try to take them back to the page they were on, and only redirect to the root path as a fallback. Ideally users wouldn't be able to use the UI to navigate to actions they're not authorized to execute but this small change will make the experience slightly better if they are able to.
Configuration menu - View commit details
-
Copy full SHA for db3607b - Browse repository at this point
Copy the full SHA db3607bView commit details -
Use govuk-link class in "View permissions" link
Calum spotted that I'd missed this.
Configuration menu - View commit details
-
Copy full SHA for abc6989 - Browse repository at this point
Copy the full SHA abc6989View commit details -
Improve display of permissions table
To avoid the column widths varying based on the length of text in the (permission) Name column.
Configuration menu - View commit details
-
Copy full SHA for daa545c - Browse repository at this point
Copy the full SHA daa545cView commit details -
Namespace the ApplicationPolicy
In order to allow Publishing Managers to remove their own signin permission from apps I'm going to need an instance of the Application so that I can check whether it has delegatable permissions. This preparatory change will allow me to pass an instance of Application to `authorize` in order to automagically find this `Account::ApplicationPolicy` class.
Configuration menu - View commit details
-
Copy full SHA for 02b87fe - Browse repository at this point
Copy the full SHA 02b87feView commit details -
Move permission from UserPolicy to ApplicationPolicy
In preparation for allowing Publishing Managers to use the /account/applications page. Publishing Managers can only remove their signin permission from an application if the application has delegatable permissions, so we need an instance of Application to check whether the user is authorized to remove their access. I've chosen to move all permission related methods over to keep them together.
Configuration menu - View commit details
-
Copy full SHA for b6c3b14 - Browse repository at this point
Copy the full SHA b6c3b14View commit details -
Allow Publishing Managers to use /account/applications
Publishing Managers can: - View permissions for all applications they have access to - Remove their access from applications with delegatable permissions Publishing Managers cannot: - Grant themselves access to applications - Remove their access from applications that don't have delegatable permissions
Configuration menu - View commit details
-
Copy full SHA for a6d89dd - Browse repository at this point
Copy the full SHA a6d89ddView commit details -
Don't display "Grant access" button to Publishing Managers
Publishing Managers aren't allowed to grant themselves access to applications so we shouldn't show them this button.
Configuration menu - View commit details
-
Copy full SHA for defd389 - Browse repository at this point
Copy the full SHA defd389View commit details -
Conditionally display the "Remove access" button
Publishing Managers can only remove their access from applications that have delegatable permissions. We should only display the button if they're allowed to remove their access.
Configuration menu - View commit details
-
Copy full SHA for 036a2ee - Browse repository at this point
Copy the full SHA 036a2eeView commit details