I am creating a lead management system. We work with call centers that generate leads for us. I have created a cpt "leads" for storing leads. a cpt "centers" for storing call centers and four user roles(agents, centers, managers, master) for adding and managing leads and users. Here are the permissions I have assigned for user roles:
Agents can
1) Add new leads
2) View and comment on their leads
Centers can
1) Add new agents
2) View their agents and their agents' leads
Managers can
1) View and edit all leads
2) Comment on all leads
Master can
1) View, Comment, Add, Edit, Delete All Leads and Centers
2) View, Comment, Add, Edit, Delete Agents and Managers
I want to connect user role "centers" with cpt "centers". Then i will allow "centers" to register new "agents" and manage their agents and their agents' leads.
Hello,
I assume each "centers" user can manage only one "centers" post.
If it is, you can setup the "centers" post author as the specific "centers" user.
Then create a page, for example "My centers", display a post view:
- Query "centers" posts
- Filter by post author is current logged-in user:
https://toolset.com/documentation/user-guides/views/filtering-views-query-by-author/
Hi,
No, a "centers" user can have many child users(agents) and a "centers" user can manage all the "leads" generated by its "agents".
You are asking the question:
I want to connect user role "centers" with cpt "centers"
I suggest you try these:
1) setup "centers" user as the post author of "centers" post,
2) Setup one-to-many relationship between post type "centers" and "agents"
o after "centers" user logged into your website, you can display a page "My centers", in this paly display his own "centers" posts with a view, see my answer above:
https://toolset.com/forums/topic/connecting-users-to-cpt/#post-2128589
In views loop, you can display a child post view:
- Query "agents" posts
- Filter by post type relationship between "centers" and "agents"
https://toolset.com/course-lesson/displaying-related-posts/#displaying-many-related-items
- In views loop, display "agents" post information + edit "agents" post form link