suntrop Posted May 11, 2018 Share Posted May 11, 2018 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). Link to comment Share on other sites More sharing options...
elabx Posted May 14, 2018 Share Posted May 14, 2018 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. Link to comment Share on other sites More sharing options...
suntrop Posted May 14, 2018 Author Share Posted May 14, 2018 Well, that makes sense ? I thought there is something wrong, but if that’s right it is ok thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now