Jump to content

check process module permission


Spica
 Share

Recommended Posts

I have some process Modules with own permission per module and assigned them to admin pages. Is it possible, to check by api if a user has access to one or all of these pages/processmodules? I only find how to check if a user has a certain permission. But what if I want to check generally if he has access, without knowledge of its permissions, e.g. to redirect to another page?

Link to comment
Share on other sites

I now solved it like this

    //search the first viewable child and redirect
    public function ___execute() {
        $moduleChildren = $this->page->children;
        foreach ($moduleChildren as $modulechild) {
             if ($modulechild->viewable()) {
                $this->session->redirect($modulechild->url);
                return;
            }
        }
    }
  • Like 1
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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