Skip Navigation

[Resuelto] How to lock a child custom post type to a specific user role.

This support ticket is created hace 8 años. 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/Hong_Kong (GMT+08:00)

This topic contains 6 respuestas, has 2 mensajes.

Last updated by Luo Yang hace 8 años.

Assigned support staff: Luo Yang.

Autor
Mensajes
#276348
16-01-2015 14-55-08.jpg

I am trying to: ensure that a child custom post type is locked to certain user roles.

I have a parent custom post type of 'vendor' and a child custom post type of 'vendor-review' and I have a user role type of 'vendor' who can only edit their own listing. I want to ensure that vendors are NOT able to create, edit or delete any vendor reviews on the back end.

The vendor listing shows all child vendor reviews within the 'edit' screen of the vendor custom post type. How do I hide this, or lock it so that vendors are not able to alter or delete reviews.

I visited this URL: its an admin link, so without login details you won't be able to see it.

I expected to see: hopefully a list of all the child reviews for that vendor greyed out or hidden entirely.

Instead, I got: Was all the child custom post types fully editable within the parent vendor edit screen.

#276679

Luo Yang
Supporter

Languages: Inglés (English ) Chino simplificado (简体中文 )

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

Please try Access plugin, more help:
Access Control for Standard and Custom Content Types:
https://toolset.com/documentation/user-guides/setting-access-control/

#276753

Hi Luoy,

Access has caused known problems in the past and I've had to stop using it as it was the only plugin that clashed with everything else and caused it to stop working.

What else can I do?

Cathie.

#276913

Luo Yang
Supporter

Languages: Inglés (English ) Chino simplificado (简体中文 )

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

I suggest you try Access and feedback if there is any problem you meet, and if it is a bug, I will forward it to our developers to fix.

#277163

Luo Yang
Supporter

Languages: Inglés (English ) Chino simplificado (简体中文 )

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

I suggest you modified the access settings:
hidden link
post type "Vendor Reviews"

enable the "Publish" privileges for the user role "Subscriber"

please feedback if there is any "problem clashed with everything else". thanks

#277280

Why would I change the publish privileges for the Subscriber? I don't want them to have any access at all.. what would making this change accomplish as I'm confused?

#277418

Luo Yang
Supporter

Languages: Inglés (English ) Chino simplificado (简体中文 )

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

Access is using wordpress User Levels system to manage the user roles.
According to wordpress document:
http://codex.wordpress.org/Roles_and_Capabilities#Capabilities

You will need set user role "Vendor" as a lower role, which can not be able to create, edit or delete posts of post type "vendor reviews".