• Resolved jmcanfield

    (@jmcanfield)


    Hi Alex,

    Thank you for the plugin, I just have a quick question. Is there a function I can call that will provide the Post IDs that a user or group has access to?

    My theme has an “Instant Search” feature that displays search results as you type (much like Google.com does). The problem is that it shows ALL possible results, and not just ones that a user has access to. I’m hoping to modify the theme by checking first if the user has access to a post before the theme displays it.

    I did see this code snippet about returning groups that a user is in, but not posts that a user has access to: https://github.com/GM-Alex/user-access-manager/wiki/Code-Snippets

    Any input at all about this would be greatly appreciated. Thanks!

    John

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author GM_Alex

    (@gm_alex)

    Hi John,

    it could be that 2.0.10 resolves your problem without adjustments, just try it. If not use the following code to get all excluded posts and filter them:

    global $userAccessManager;
    
    if (isset($userAccessManager)) {
        $uamAccessHandler = $userAccessManager->getAccessHandler();
        $excludedPosts = $uamAccessHandler->getExcludedPosts();
    }
    Thread Starter jmcanfield

    (@jmcanfield)

    Fantastic, thank you Alex!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Is there a function that will show all posts the user has access to?’ is closed to new replies.