• Resolved psypat

    (@psypat)


    Hi!

    I’ve detected that a user that is registered as contributors can access the Admin search in the menu, that must be some kind of mistake?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mikko Saari

    (@msaari)

    No, it’s not. The admin search is, by default, available to everyone with the edit_posts capability, which includes contributors. It doesn’t grant anyone any access to something they otherwise wouldn’t be able to access.

    If you want to restrict the admin search, you can use the relevanssi_admin_search_capability filter hook to change the required capability. If you want to restrict it to only authors, use publish_posts; to editors, use edit_others_posts.

    add_filter( 'relevanssi_admin_search_capability', function( $cap ) {
      return 'edit_others_posts';
    } );
    Thread Starter psypat

    (@psypat)

    Hi, sorry for the long delay in my answer, but apparently didn’t wordpress send me any notification..

    I’m pretty new at wordpress, it is enough to add that string to functions.php to prevent relevanssi ADMIN search for everybody except admin?

    Plugin Author Mikko Saari

    (@msaari)

    Yes, add it to theme functions.php or in a code snippet plugin.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Restrict Admin search to Admin ?’ is closed to new replies.