Control of access to content (by the manager) by user roles
Hello,
I would like to know how to control access to the contents of the site by user role, by the manager, with the Toolset settings, or by code. If it is possible only with code, can you give me a direction?
Here is an example of functionality found in another plugin:
hidden link
I'm waiting
Thank you
Hello and thank you for contacting the Toolset support.
Toolset Access plugin is designed just for that with deep integration with other Toolset plugins and WPML plugins.
Please check all the articles on this page, each one of them will answer a part of your question.
https://toolset.com/documentation/user-guides/access-control/
If you have any doubts about anything, let me know, and I'll do my best to explain it.
Hello good day...
I read all the links sent and I didn't find the main one of my question, I may not have been clear enough, but what I need would be: on the posts list screen (in the standard wordpress manager), display only your own posts (filter by author), I cannot let other authors see posts that are not yours (only if I give permission).
I didn't find an option for that in Access.
How can I do this?
Thank you
Hello,
The documentation is pretty extensive on how to assign permissions to roles, how to manage access to custom post types, taxonomies, forms with roles or users, and finally how to group selected posts on an access group.
So, maybe if you can provide a detailed example, I can give you better advice.
Regarding your last reply, do you mean on the backend or on the frontend?
Can you give an example of a post type, some roles, and some users and explain which one should see what?
Thank you
Hello,
My whole question is based on the back-end, the standard wordpress post manager, after the user logs in to the platform. on the attached screen.
thank you
Thank you,
Toolset Access won't help with restricting access to the default Posts list in the backend. You can get that by, either a custom code, or using a 3rd party plugin. Put this into your functions.php file in your theme folder:
function query_set_only_author( $wp_query ) {
global $current_user;
if ( is_admin() && !current_user_can('manage_options') ) {
$wp_query->set( 'author', $current_user->ID );
}
}
add_action('pre_get_posts', 'query_set_only_author' );
Have a look here for a more complete solution (fixes the post count on the filter bar):
https://wordpress.stackexchange.com/questions/34765/help-to-condense-optimize-some-working-code
This 3rd party plugin is providing the same feature for media and posts https://wordpress.org/plugins/view-own-posts-media-only/
I hope this answers your question. Let me know your feedback.