public function checkRole(DataObject $node, $role, $member = null)
    {
        $role = DataObject::get_one('AccessRole', '"Title" = \'' . Convert::raw2sql($role) . '\'');

        if ($role && $role->exists()) {
            $composedOf = $role->Composes->getValues();
            if ($composedOf && is_array($composedOf)) {
                foreach ($composedOf as $perm) {
                    if (!$this->checkPerm($node, $perm, $member)) {
                        return false;
                    }
                }
                return true;
            }
        }
        return false;
    }
public function checkRole(DataObject $node, $role, $member = null)
    {
        $role = DataObject::get_one('AccessRole', '"Title" = \'' . Convert::raw2sql($role) . '\'');

        if ($role && $role->exists()) {
            $composedOf = $role->Composes->getValues();
            if ($composedOf && is_array($composedOf)) {
                foreach ($composedOf as $perm) {
                    if (!$this->checkPerm($node, $perm, $member)) {
                        return false;
                    }
                }
                return true;
            }
        }
        return false;
    }
public function checkRole ( DataObject $ node , $ role , $ member = null ) { $ role = DataObject :: get_one ( 'AccessRole' , '"Title" = \'' . Convert :: raw2sql ( $ role ) . '\'' ) ; if ( $ role && $ role -> exists ( ) ) { $ composedOf = $ role -> Composes -> getValues ( ) ; if ( $ composedOf && is_array ( $ composedOf ) ) { foreach ( $ composedOf as $ perm ) { if ( ! $ this -> checkPerm ( $ node , $ perm , $ member ) ) { return false ; } } return true ; } } return false ; }
Check for the presence of ALL permissions in a given role for the user to an object

@param DataObject $node
The object to check perms on
@param string $role
The role to check against
@param Member $member
The member to check -if not set, the current user is used
Check for the presence of ALL permissions in a given role for the user to an object