Jump to content

Recommended Posts

Posted

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

Posted
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.

  • Like 5

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...