Skip Navigation

[Résolu] Restricted access to CPT based on User roles

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:
I needed to restrict access to my CPT based on User roles, but it didn't work as I expected. I tried to bring the native WordPress "Post" type under Access control, which helped to solve the problem, is it a bug?

Solution:
This is actually not a bug, it works like this because some of access permissions are inherited from built-in WordPress permissions and capabilities. So we can say this is by design and how the Access plugin handles user role permissions.

Relevant Ticket & Solution:
https://toolset.com/forums/topic/access-isnt-granting-access-for-custom-roles/

This support ticket is created Il y a 6 années et 2 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Marqué : 

Ce sujet contient 4 réponses, a 2 voix.

Dernière mise à jour par toolset-dave Il y a 6 années et 2 mois.

Assisté par: Noman.

Auteur
Publications
#1119195

Hi,

I needed to restrict access to my CPT based on User roles, but it didn´t work as I expected. If I checked "Edit any", "Edit own", "Preview any" and "Read", the user with these specified permissions could not edit the CPT which was created by anyone else (only the ones the user created). I was trying to set up Custom Roles but nothing helped. Finally I have found https://toolset.com/forums/topic/access-isnt-granting-access-for-custom-roles/ and tried to bring the native WordPress "Post" type under Access control. Which helped to solve the problem. So my question is: Should the Access plugin work like this or is it a bug?

#1119300

Noman
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting Toolset support. This is actually not a bug, it works like this because some of access permissions are inherited from built-in WordPress permissions and capabilities. So we can say this is by design and how the Access plugin handles user role permissions.

Thank you

#1119752

Thanks for the explanation. But I couldn´t find it in documentation (i.e. here: https://toolset.com/documentation/user-guides/setting-access-control/). So maybe it would be useful to mention that standard WordPress Posts must be managed by Access (in documentation or in plugin). Also its confusing if I have to check "Manage by Access" on my CPT, not to have checked "Same read permission as posts" and also not checked "Use the default WordPress read permissions", but as you said, some permissions are still inherited from WordPress...

#1119973

Noman
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Karachi (GMT+05:00)

Ok thanks for the feedback, we will review and forward your suggestions to the doc team.

Have a great day, thanks

#1120132

Thank you!