CRM457-2019: Move all authorisation logic to Pundit #819
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of change
authorize
calls to controller layer so that users can no longer access screens that are associated with permissions they don't haveauthorize
norskip_authorization
, Pundit will raise an error. This ensures we don't accidentally forget to add authorisation to new actions etc.Link to relevant ticket
Notes for reviewer
The NSM controller specs all broke because Pundit doesn't play nicely with doubled Claim objects. As those controller specs were pretty shonky (they were line-by-line describing the controller code and stubbing every instantiated view model instead of describing the behaviour of the controller), I've rewritten a lot of them.