COMCL-730: Fix Case Permissions Issue #1039
Merged
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.
Overview
This pr fixes an issue with case permissions which led to permissions being cached and did not change when the user role was changed.
Before
For example the user without delete permission was able to see the delete case option
After
Technical Details
Previously the case actions were being provided as part of civicase.ang.php which is read only once and then its cached for the rest of the users. So if a user with admin permission uses the site first then all other non admin users will also see the same options on the cases screens. This pr moves the cases actions and other settings to a settings factory which leads to refreshing the settings for each page load.