I’m working on a project which requires that certain people have limitted access to the admin area. I have created a new Role for this type of admin user, but I also need the following for this specific set of users:
- A few additional fields, like “Company Name” and “Phone Number”
- Ability to hide these users from System -> Permissions -> Users
- They will appear in a separate grid somewhere else
- Maintain the ability for them to login to the admin area, reset their password if forgotten, etc
- All of these ‘specialized’ users will always have the same role.
I have the following ideas, but I’m not sure which (if any) are best practices:
- Storing the data in the db
Use theextrasfield for storage- Create a new table with the same
PKas the user, plus the additional fields
- Implementing the model
- Extend
Mage_Admin_Model_Userand the collection; use these within my module only instead of the standard classes Extend & override the above so that all admin user objects have the functionality
- Extend
My question: What approach would work best for this scenario? Maybe you have an even better idea than I do
Bonus: free internets will be given for including any sample code, tutorials, references, etc which demonstrate how to do accomplish the given approach.
Edit 1: The more I think about it, the more I feel the non-crossed-out options above would work best. My custom modules are the only ones who really need that extra functionality. The only override would be for the original user collection, to add a filter to exclude these ‘other users’ from the default user admin screens.
I would go with Implementing and Extending
Mage_Admin_Model_Userif they are backend oriented users.1) Adding additional fields should be pretty trivial. See table
admin_userin the db.2) I would add another field also to item 1 with a flag for these “special” users.
2a) Query a collection based on the flag and display the results in the grid, set the action to take them to the edit page the preexisting admin users.
3,4) Implementing the existing Admin model would allow for such without any code.