Jump to content

Recommended Posts

Posted

I am wondering why I need to add check_access to filter user roles

// $page->members is a Page reference field to users
$members = $page->members('roles=staff, check_access=0'); // output: 4 (for none superusers)

$members = $page->members('roles=staff'); // output: 0 (for none superusers, but 4 for superusers)

 The members field is just a list of people belonging to a certain group. The group is split into users with the role 'staff' and those with just a 'member' role. I want to get only those with the staff role (and later those without that role).

Posted

I guess that's because users are pages under admin, so If a user with "guest" role (which is the default for every request made to the site) runs that code, it won't normally have access to that data, unles specified with check_access selector. 

Posted

Well, that makes sense ?

I thought there is something wrong, but if that’s right it is ok 

thanks 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...