Improve page display after losing the Run rules permissions
During testing I noticed that when a user loses the permission to running a rule, but does not leave the page yet and tries to execute the rule then a message appears that the page is not available.
Steps to reproduce
- Go to https://test.pcmt.villagereach.org/
- Login as admin/Admin123
- Open two separate tabs.
- On the first tab go to System > Rules and create a new rule.
- On the second tab go to System > Roles and for Administrator uncheck the "Run rules" permission and save the changes.
- Go to the first tab and click the "Run a rule" button.
What is the current bug behavior?
- Currently, the page is no longer available. Although the user only lost access to run the rules and after reloading the correct page appears.
What is the expected correct behavior?
- The "Run a rule" button should disappear after a page reload and a message appear that the user has no access.