Skip Navigation

[Resuelto] Limiting to view custom post based on author

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:
The issue here is that the user wants to restrict his users to only be able to see and edit their own posts.

Solution:

To do this you can follow the instructions in our documentation in the link below.
https://toolset.com/documentation/user-guides/setting-access-control/#managing-access-control-for-posts-pages-and-custom-post-types

This support ticket is created hace 6 años, 8 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por rafaelL-2 hace 6 años, 8 meses.

Asistido por: Shane.

Autor
Mensajes
#625307

Tell us what you are trying to do?

let's imagine the following example

User01, role "normaluser" have 1 custom post type called "myinfo"
example.com/myinfo/privatedate03

User02, role "normaluser" have 2 custom post type called "myinfo"
example.com/myinfo/privatedate
example.com/myinfo/privatedate02

I want to avoid User02 can see the post of User01 and User02 see the post of User01.

Is there any documentation that you are following?
Yes, but I didn't found anything useful to me. I know how roles work but I can't apply because my site will have more than 100 users. I can't make a role for each one.

I think I will need to use views inside the template for "myinfo" slug , or I am missing something?

Regards

#625428

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Rafael,

Thank you for contacting our support forum.

If you give the roles an Edit Own privilege, then the users of that role will only be able to edit their own posts.

https://toolset.com/documentation/user-guides/setting-access-control/#managing-access-control-for-posts-pages-and-custom-post-types

Please try this and let me know if it helps.

Thanks,
Shane

#625632

Hi Shane,

Seems I don't give a correct explanation. Your solution is OK for normal situations, but I have a role who can see other post based on a custom user field so I solve using a function shortcode, then this function returns 1 is can see the content and 2 if now.

Then I register that shortcode on wp-types setting, and add is as conditional view 🙂

many thanks for your time