Skip Navigation

[Resolved] Control of access to content (by the manager) by user roles

This support ticket is created 3 years, 11 months ago. 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: Africa/Casablanca (GMT+01:00)

This topic contains 5 replies, has 2 voices.

Last updated by Jamal 3 years, 11 months ago.

Assisted by: Jamal.

Author
Posts
#1626039

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

#1626347

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

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.

#1629023

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

#1630939

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

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

#1631281
Capturar.PNG

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

#1631795

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

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.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.