Manaus Posted October 1, 2013 Share Posted October 1, 2013 Hello, my user (41) logs in, I need to know if he has permission to see that page. To enforce granularity, each page has a 'user' field, for example (41|1010). How do I check whether the user can see that page? I'm evaluating the strpos php function, but I fear it might lead to error. Note it's not about roles, each user can see one or more pages. Thank you very much Link to comment Share on other sites More sharing options...
arjen Posted October 1, 2013 Share Posted October 1, 2013 if ($page->user->has($user)) { // Do stuff } Not tested, but something like this would work since the "user" fields returns a array which you can check all kinds of thing in. See the cheatsheet for more info. 5 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