Skip Navigation

[Resolved] Implementing User-Specific Data Access

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 0 voices.

Last updated by matthiasK-4 2 months, 1 week ago.

Assisted by: Minesh.

Author
Posts
#2781289

I have developed a WordPress-based website using Toolset, enabling our customers to view and manage their data seamlessly. The data structure includes the following tables:

- **Customers** (customer information)
- **Contacts**
- **Domains**
- **Autoresponders**
- etc.

### Data Relationships
- Each customer can have multiple associated contacts.
- Each customer can own multiple domains.
- Each customer can manage several autoresponders.
- etc.

### Access Requirements
Each customer should be able to see, edit, and delete only their own data. To test this setup, I created a user with the role of “author” for a sample customer and linked all relevant posts to this user. In Toolset I restricted the access to admins and the related author. However, manually assigning roles or authors for every new data entry is not scalable.

### Optimized Access Solution
Given that each user corresponds to a single customer and all his data is associated with this customer, an efficient method for data access control is required. This will ensure that users are automatically granted permissions relevant to their associated customer data.

### Example Scenario
**Customer: Amargo** (with associated users A and B)
- **Related Contacts**: Contact 1, Contact 2, Contact 3
- **Related Domains**: Domain 1, Domain 2
- **Related Autoresponders**: Autoresponder 1, Autoresponder 2, Autoresponder 3

**Customer: CustomerName** (with associated user C)
- **Related Contacts**: Contact 8, Contact 9
- **Related Domains**: Domain 3, Domain 5
- **Related Autoresponders**: Autoresponder 7

### User Access Control
- **Users A and B** should have exclusive access to:
- Contacts: Contact 1, Contact 2, Contact 3
- Domains: Domain 1, Domain 2
- Autoresponders: Autoresponder 1, Autoresponder 2, Autoresponder 3

- **User C** should have exclusive access to:
- Contacts: Contact 8, Contact 9
- Domains: Domain 3, Domain 5
- Autoresponder: Autoresponder 7

By implementing a dynamic permission system based on user-customer relationships, we can automate data access controls and improve site management efficiency.

Is there a way to achieve this?

#2781589

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Toolset Access works based on the role. If you want to assign the permission for own content then you should assign the permissions to the designated role.
- https://toolset.com/course-lesson/setting-access-control/

Please check the following link:
- https://toolset.com/lesson-placement/lesson-placements-1622969-1655453/
- https://toolset.com/related-lesson/access-control/

#2782566

Hello, thank you for your response.

I need a bit more clarification on how to use roles in this scenario. In the lessons provided, users can edit different items based on their role, but they’re limited to editing only their own content.

I’m looking for a solution where users can also edit content created by other users, provided they are associated with the same company.

For example, in the context of gyms, I’d like multiple users to be able to edit the same gym’s details.

#2782568

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

#2782570

I'll test it as soon as possible and follow up with feedback. Thank you!

#2782672

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

ok fine. Please check it and let me know how it goes.

#2782759

Unfortunately, this is not the solution I need. I would have to manually assign each post of every user to a post group. Since there are several thousand entries and new ones are continually added by customers, this is not a viable solution.

I will now resolve it by creating only one user per customer, so the assignment to the customer will always happen automatically through the author.