-
-
Notifications
You must be signed in to change notification settings - Fork 437
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
Reload admin ACL #1714
Reload admin ACL #1714
Conversation
What is the benefit of this? The user's role cannot be changed on that page so the ACL shouldn't need to be updated. Also the response will just be sent next and nothing else until the next request. |
This allows admins to reload ACL without logout. |
Ahh, I see. The stock ACL reload mechanism is rather broken as you noticed.. For one it doesn't make sense to store the ACL in the session, it should be stored in cache. Also it should be possible for one ACL to be cached for all users and any time any role is updated the cache can be invalidated so the next user's request will refresh the cache for all users. That would solve this problem as well as some others and be faster and less demand on the session backend. |
I found this solution on stackexchange...
I searched and I found |
@colinmollenhour This would also help cases where you have a dynamic menu in Admin (i.e. we have a report section that is auto-populated with more SQL reports, depending on some settings and the user). |
app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php
Outdated
Show resolved
Hide resolved
Tested again, still works. I'm surprised that "a/" is already working... |
I think this PR is a great addition, having to logout/login it's simply not a very nice thing to ask users. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good changes. 👍
review was based on outdated code
Description
This PR allow to reload admin acl without logout/login:
OpenMage 20.0.13 / PHP 7.4.6 + 8.0.18.
Manual testing scenarios
You can add the following line in app/code/core/Mage/Admin/Model/Session.php on line 221 to add a success message when ACL is reloaded:
Mage::getSingleton('adminhtml/session')->addSuccess('ACL reloaded.');
Contribution checklist