Support » Plugin: PublishPress Permissions: Control User Access for Posts, Pages, Categories, Tags » pp & searches plugins (serach reults visible for restricted posts)

  • Resolved pmirek

    (@pmirek)


    Is there an easy way to integrate PP with other plugin searches? At the moment ajax search lite gives summary of pages that are restricted.
    Can you give any information about which PP functions should be called from other plugins to return information if specific user can see specific page/search result?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Kevin Behrens

    (@kevinb)

    That plugin (any many other search plugins) retrieves content from the database (using the WP_DB class) in a way which does not expose the query clauses to other plugins.

    The surest way to avoid unwanted content exposure is use WP’s native post privacy setting to restrict access. Press Permit may then be configured to grant access to your user or group on a per-post or per-term basis. Third party search plugins will not necessarily recognize those permissions, but the default will be universal suppression of private posts from the search results.

    If you choose to rely on PP exceptions to impose viewing restrictions, plugins which call the WP_Query class on each search request should work with Press Permit. However, result caching will usually need to be avoided for logged in users. As an FYI for Pro users, I’ve developed particular support for the Relevanssi plugin using its own API. However, I still consider avoidance of proprietary search queries the best solution.

    Plugin Author Kevin Behrens

    (@kevinb)

    Can you give any information about which PP functions should be called from other plugins to return information if specific user can see specific page/search result?

    $can_read = current_user_can( 'read_post', $post_id );

    Press Permit Core filters that function based on your customizations.

    Thread Starter pmirek

    (@pmirek)

    You are totally right. This one brilliant line saved my day!

    Thread Starter pmirek

    (@pmirek)

    FYI: This integrates nicely with search-in-place plugin.
    With three lines of code you can get great permissions engine from your code of press-permit-core with dynamic & permission filtered search from modified ‘search-in-place’ that calls your function.
    Cool!

    • This reply was modified 5 years ago by pmirek.
    • This reply was modified 5 years ago by pmirek.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘pp & searches plugins (serach reults visible for restricted posts)’ is closed to new replies.