Conversation
awilfox
left a comment
There was a problem hiding this comment.
This is good, but it's needed at app/controllers/reference_card_forms_controller.rb:87 as well.
|
Yes, there maybe other forms. |
There was a problem hiding this comment.
I'm in agreement with @awilfox. Does this need to be added to everything that inherits from AuthenticatedFormController that also has before_action :require_admin!? I think that includes ProxyBorrowerAdminController, ReferenceCardFormController, and StackPassAdminController.
In addition, AP-595 also says we should do something about Edit: I'll make a separate issue to deal with this - we have a lot of forbidden pages that are fairly inconsistent.framework/app/views/home/forbidden.html.erb. The text on that page says "Only Library IT developers can access this page." What would be the impact of deleting that view file?
|
Honestly, I think the entire concept of "require a user and a role" should probably be its own helper; this was a foot-gun I tripped over. Something like |
|
Maybe we all can chat after standup tomorrow to confirm a path forward? |
|
Many other forms use this role check method; only a couple of forms are missing the authentication step. As I mentioned in the ticket, we could consolidate all of these role-check methods into a single place. However, we need to carefully review the roles during the update, as they may be implemented differently across forms. Also, we may also add a CalNet error page, when missing CalNet attributes. |
|
I agree that sounds like the best way forward. Bring the logic into one place, and verify that the roles are being checked correctly on all forms. Adding a CalNet error page for when attributes are missing sounds like a good idea but should probably be in a separate ticket / MR IMO. |
|
Controllers like Although some of the other controllers inherit from We only need to add authenticate to |
anarchivist
left a comment
There was a problem hiding this comment.
thanks for following up on this. r+; looks good to me.
awilfox
left a comment
There was a problem hiding this comment.
Looks good! Thank you for your thorough investigation of this. r+
Add authenticate before checking user role in StackPass form.