plugin.xml creating userClasses that are managed only by Main Admin or designated userClass? #5009
Unanswered
Vodhin
asked this question in
Q&A Plugins
Replies: 1 comment 3 replies
-
HI, I don't have an answer, I didn't know that you can add classes by plugin.xml either. But I needed this too and I solved it by using plugin_setup.php file, install_post() method, and SQL query to add or update this stuff. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am creating a Real Estate plugin that can handle multiple property listings. What controls each listing is the Estate Company, which have their own Agency Locations to which individual Agents are assigned (as a home base). I am assuming that someone who adopts this plugin would likely be manually adding Users by creating a login profile for each of their employees with Admin and Estate Plugin permissions, and the Main Admin doing something similar to onboard Companies.
The plugin is capable of handling multiple companies, so it requires some user credentials to prevent cross-company access. I would like my plugin to create three special user classes when installed, which are used by my plugin to determine what a user can do:
Each of these classes need to be regular Admins with permissions to access the Estate Plugin, and I would like the estate_admin to be able to assign the estate_manager and estate_agent class to any User, and the estate_manager to be able to assign the estate_agent class to any User (understanding that each User would need to be made an Admin with Estate Plugin access).
I've added the following to the
<userClasses>
tag in my plugin.xml<class name="estate_admin" description="Estate Plugin Administrator" />
<class name="estate_manager" description="Estate Agency Manager" />
<class name="estate_agent" description="Estate Agent" />
which works fine for creating the user classes but by default they are visible to and selectable by any member in their own user settings page. I've looked though the plugin_class.php file and it seems that no other attributes can be added through the plugin.xml file.
It would be great to be able to do something like:
<class name="estate_agent" manager="250" visibility="250" description="Estate Admin" />
or even
<class name="estate_admin" manager="250" visibility="250" description="Estate Agent" />
<class name="estate_manager" manager="250,estate_admin" visibility="250,estate_admin" description="Estate Agency Manager" />
<class name="estate_agent" manager="250,estate_admin,estate_manager" visibility="250,estate_admin,estate_manager" description="Estate Agent" />
Beta Was this translation helpful? Give feedback.
All reactions