magento-lts
magento-lts copied to clipboard
Remove deprecated Admin user multirole functionality
Description (*)
This PR aims to get rid of all the remnant code of multi-role functionality for Admin user. This functionality was deprecated ages ago and it's just tech debt at this point. Currently, only one Role can be assigned to an Admin user.
This is not meant to introduce any major breaking changes, although I did a change in a template file in adminhtml, but that's because I doubt someone will have that file overridden.
Todo
- [ ] Consolidate
Mage_Admin_Model_Resource_User::saveRelations()andMage_Admin_Model_Resource_User::add()methods, both used to add a role to a user. - [ ] Deprecate methods that operate on array of roles (e.g.
Mage_Admin_Model_Resource_User::getRoles), and replace them with methods that work with a single role.
Manual testing scenarios (*)
- Assigning a Role to an Admin user from user edit page should work as usual.
- Assigning a Role to an Admin user from role edit page (Role Users tab) should work as usual.
Contribution checklist (*)
- [x] Pull request has a meaningful description of its purpose
- [ ] All commits are accompanied by meaningful commit messages
- [ ] All automated tests passed successfully (all builds are green)
- [x] Add yourself to contributors list
does it need to be in the 19.x releases?
does it need to be in the 19.x releases?
Not necessarily, I can change the target branch when I'm done.
Created a bit of a mess, but this refactor will now target v20.
does it need to be in the 19.x releases?
Why not remove dead code at all?
@elidrissidev what do we need to finish this?
@elidrissidev do you remember what's needed in order to finish this PR?
The Admin code is kinda messy and all over the place, the current state of the PR should be working fine, but there's still some classes that seem useless and could be removed (e.g. Mage_Admin_Model_Roles could be merged with Mage_Admin_Model_Role model since they represent the same entity) but I don't remember if refactoring will break BC.
I kinda think that this should be in next but, @elidrissidev do you think you'll restart your work on this or what should we do on this PR?