Skip Navigation

[Resolved] restricting access based on relationships between posts

This support ticket is created 4 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by Zayne 4 years, 10 months ago.

Assisted by: Waqar.

Author
Posts
#1460415

One of the biggest issues I have at the moment is that I cannot restrict access to content based on the relationships between posts. I have a publishing site where there are a group of researchers working together on a single composers' works, creating an edition of that composer's works. Each Edition has multiple Works related to it.

However, there are multiple research groups working on multiple editions, by different composers. With Toolset I can't find a way for me to say that Research group A is working on an Edition for Composer A, so this research team should only see the works related to Composer A's Edition and shouldn't see any other Composers Editions or Works. What I've had to do is use WordPress Multisite and have a separate site for each Composer's Edition. This means that I have to replicate all the Toolset objects between all sites. This is very laborious.

Is there any way to do this?

#1461957

Hi there,

Thank you for contacting us and I'd be happy to assist.

Based on what you've shared, this is how I would structure post types and the relationships between them, so that it becomes easier to show only the related content.

1. Post Types:

a). Researchers
The post type that will link each registered researcher user on the website, with other post types. We'll need this, as a "post-relationship" can only be created between two post types and not directly between a post type and a user.

Here is a useful guide on this topic:
https://toolset.com/documentation/post-relationships/how-to-create-custom-searches-and-relationships-for-users/

b). Composers
Will hold each composer

c). Editions
Will hold each edition

d). Works
Will hold each work

e). Research Groups
Will hold each research group

2. Post relationships:

a) Edition -> Works
A one-to-many relationship where a single edition can have multiple works.

b). Composers -> Editions
A one-to-many relationship where a single composer can have multiple editions.

c). Research Groups <-> Editions
A many-to-many relationship as multiple research groups can work on multiple editions.

d). Research Groups <-> Researchers
A many-to-many relationship as multiple researchers can be part of multiple research groups.

As a result, when a researcher will be linked to a research group and that research group is linked to specific editions, it would be easier to show only the list of relevant editions and works him/her.
( ref: https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/ )

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1462509

Thanks Waqar. This is exactly how I have structured the site at the moment, except for the researcher->user relationship, which I didn’t know you could do! Thanks for that.

I realise now that I wasn’t clear that I was trying to do this in the backend. However, I see now that of course Toolset won’t do this, as it is deals with the front end output.

The main reason that my clients are still using the admin interface is that I am using WooCommerce to sell scores but I cannot yet give the clients all the capabilities of WooCommerce via front end forms. In particular, the client needs to upload multiple files that are downloaded with the pdf scores.

Thanks for your help.