Support » Plugin: Role Scoper » Test if user has access to read a page by ID

  • Resolved danlbob

    (@danlbob)


    I’m trying to hide certain links to pages in a template based on the current user’s role. I’ve attempted to use…

    global $scoper;
    $users_who_can = $scoper->users_who_can('read', COLS_ALL_RS, 'page', $pageID );

    …and testing the current user against that list, but that method seems to return all users in all roles. I can verify that the page is correctly restricted by logging in as different users.

    Also I’ve tried is_restricted_rs($pageID) but that returns 1 no matter what user I’m logged in as. Seems as if that may be an improper use of this function anyway.

    Clearly, this is core functionality but I must be missing something.

    Thanks in advance!

    http://wordpress.org/extend/plugins/role-scoper/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Test if user has access to read a page by ID’ is closed to new replies.