Skip Navigation

[Resolved] Can I limit a User so s/he can only see data from posts s/he created?

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.

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by shieR 6 years, 2 months ago.

Assigned support staff: Luo Yang.

Author
Posts
#302198
screenshot2.png
screenshot1.png

I'm working on a music catalog.
I have a Post Type called Track
I have a Post Type called Composer
I have a Post Type called Track Composer, which I use to create a many to many relationship between Track & Composer.

Now I want different Users to be able to enter data independently of each other and only see the data that they authored. I setup my Access privileges and that appears to work fine. As you can see in screenshot 1 (side by side signed in as Shie, which is an admin vs. Testy Testerson, which is a contributor), my Testy Testerson user can only see Test Composer and no others.

However, when Testy Testerson edits a Track and goes to attach a composer to the Track, Testy Testerson can see all the composers in the selection menu, not just Test Composer. (screenshot 2).

Is there a way to make it so that Testy Testerson will only sees composers s/he authored in the selection menu? In other words - can the popup only show the composers Testy Testerson can see in the Composer Post Type?

#302470

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

It is not possible within Types in wordpress admin side, but you can try create a CRED form in front-end,
1) setup a view to list parent posts, which author is current user
https://toolset.com/documentation/user-guides/filtering-views-query-by-author/
2) add a Generic select Field into your CRED form, use above view as the options:
https://toolset.com/documentation/user-guides/inserting-generic-fields-into-forms/

https://toolset.com/documentation/user-guides/cred-shortcodes/#cred-generic-field
nside shortcode body the necessary options and default values are defined as JSON string (autogenerated by GUI). Please note that if the value of Generic Field is to be saved in the Database, “persist?? option must be set to “1??.

See similar thread:
https://toolset.com/forums/topic/create-a-child-in-cred-form/

#302684

OK. I need to finish all my views before I start building my CRED front-end to manage my back-end. I'll look into the links you suggested when I start working on the CRED side of things.

Thanks