Skip Navigation

[Resolved] Info on where to set access control for many-to-many relationship form

This support ticket is created 5 years, 2 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
- 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 2 voices.

Last updated by Minesh 5 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#1375987

Tell us what you are trying to do? I am trying to limit access to relationship form

Is there any documentation that you are following? could not find any related document

Is there a similar example that we can see?
1) I have 2 post types (a) Product (b) Certification Program
2) I have Many-to-Many relationship between the 2 mentioned post types i.e. a product can be part of multiple certification programs and a certification program can have multiple products
3) I am able to restrict access to "product edit form" and "certification program edit form" in Toolset access control to authors of the corresponding post
4) I have a relationship form created to capture additional fields when associating a product to certification program. ISSUE: I want to restrict access to this relationship form only to either author of the product post or certification program post. I could not find a configuration in access control to add this restriction.

What is the link to your site? hidden link

#1376231

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

With Relationship Forms, the only Acess settings available is to grant access to Media library and you can find it at:
=> Toolset => Access Control => Toolset Forms tab => Relationship Forms Frontend Access

There is no native way available to set access restrictions for post author using access settings.

You can display the conditional content based on post author equal to loggedin user using the following code:

 [wpv-conditional if="( '[wpv-current-user info="ID"]' eq '[wpv-post-author format="meta" meta="ID"]' ) "]
      // add your relationship form here.
[/wpv-conditional]

Please check our Docs for additional shortcode attributes:
=> https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-author
=> https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-current-user

#1376525

Hi Minesh -

I added the conditional code you shared in the elemental single page where this relationship form is placed. It is not working.

Attached are 2 screenshots
(1) original shortcode to display the relationship form - which always displays the form
(2) updated shortcode (based on the code you shared) - the form is not displayed though the current user and the post author are same. (Note: I have checked the above in preview mode as well - though the screenshot is not of the preview mode)

Let me know if I am placing the code in the wrong place.

Thanks

#1376833

Minesh
Supporter

Languages: English (English )

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

I see you are using Elementor. The code I shared is to check if the current post author is equal to logged-in users and as far as I can see that is what you wanted. Please let me know if this is not correct.

I see you are using the shortcode widget where you added the code I shared and that is correct. You should try to save the template and check on frontend and let me know if it works as expected. If it does not work, I need wp-admin access details so I can look at it.

I have set the next reply to private which means only you and I have access to it.

#1377495

Hi Minesh -

response to your questions in earlier message:
The code I shared is to check if the current post author is equal to logged-in users and as far as I can see that is what you wanted. Please let me know if this is not correct. --> this is correct

I see you are using the shortcode widget where you added the code I shared and that is correct. --> Thanks for confirming.

You should try to save the template and check on frontend and let me know if it works as expected. --> I did and still it did not work

If it does not work, I need wp-admin access details so I can look at it.

I have set the next reply to private which means only you and I have access to it. --> I am currently moving my website to different host, so will be able to share the info next week.

Thanks

#1377757

Minesh
Supporter

Languages: English (English )

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

Sure. Please get in touch with access details once ready.

I have set the next reply to private which means only you and I have access to it.