lib/FSi/Component/ACL/ACL.php
protected function searchParentRoleACEs($roleId, $resourceId, $permissionId, array $params = array(), $level = 0)
    {
        $allowedAny = null;
        if (isset($this->rolesParents[$roleId]) && isset($this->resources[$resourceId]) && isset($this->permissions[$permissionId])) {
            if (isset($this->logger)) {
                $this->logger->addRecord(Logger::DEBUG, sprintf("%sChecking if any parent role has specified permission to specified resource",
                    str_repeat('  ', $level)
                ));
            }
            foreach ($this->rolesParents[$roleId] as $parentRoleId => $parentRole) {
                $allowed = $this->searchACEs($parentRoleId, $resourceId, $permissionId, $params, $level + 1);
                if (!isset($allowed)) {
                    $allowed = $this->searchParentResourceACEs($parentRoleId, $resourceId, $permissionId, $params, $level + 1);
                }
                if (!isset($allowed)) {
                    $allowed = $this->searchParentRoleACEs($parentRoleId, $resourceId, $permissionId, $params, $level + 1);
                }
                if (isset($allowed)) {
                    if (!$allowed) {
                        return $allowed;
                    } else {
                        $allowedAny = true;
                    }
                }
            }
        }
        return $allowedAny;
    }
protected function searchParentRoleACEs($roleId, $resourceId, $permissionId, array $params = array(), $level = 0)
    {
        $allowedAny = null;
        if (isset($this->rolesParents[$roleId]) && isset($this->resources[$resourceId]) && isset($this->permissions[$permissionId])) {
            if (isset($this->logger)) {
                $this->logger->addRecord(Logger::DEBUG, sprintf("%sChecking if any parent role has specified permission to specified resource",
                    str_repeat('  ', $level)
                ));
            }
            foreach ($this->rolesParents[$roleId] as $parentRoleId => $parentRole) {
                $allowed = $this->searchACEs($parentRoleId, $resourceId, $permissionId, $params, $level + 1);
                if (!isset($allowed)) {
                    $allowed = $this->searchParentResourceACEs($parentRoleId, $resourceId, $permissionId, $params, $level + 1);
                }
                if (!isset($allowed)) {
                    $allowed = $this->searchParentRoleACEs($parentRoleId, $resourceId, $permissionId, $params, $level + 1);
                }
                if (isset($allowed)) {
                    if (!$allowed) {
                        return $allowed;
                    } else {
                        $allowedAny = true;
                    }
                }
            }
        }
        return $allowedAny;
    }
protected function searchParentRoleACEs ( $ roleId , $ resourceId , $ permissionId , array $ params = array ( ) , $ level = 0 ) { $ allowedAny = null ; if ( isset ( $ this -> rolesParents [ $ roleId ] ) && isset ( $ this -> resources [ $ resourceId ] ) && isset ( $ this -> permissions [ $ permissionId ] ) ) { if ( isset ( $ this -> logger ) ) { $ this -> logger -> addRecord ( Logger :: DEBUG , sprintf ( "%sChecking if any parent role has specified permission to specified resource" , str_repeat ( '  ' , $ level ) ) ) ; } foreach ( $ this -> rolesParents [ $ roleId ] as $ parentRoleId => $ parentRole ) { $ allowed = $ this -> searchACEs ( $ parentRoleId , $ resourceId , $ permissionId , $ params , $ level + 1 ) ; if ( ! isset ( $ allowed ) ) { $ allowed = $ this -> searchParentResourceACEs ( $ parentRoleId , $ resourceId , $ permissionId , $ params , $ level + 1 ) ; } if ( ! isset ( $ allowed ) ) { $ allowed = $ this -> searchParentRoleACEs ( $ parentRoleId , $ resourceId , $ permissionId , $ params , $ level + 1 ) ; } if ( isset ( $ allowed ) ) { if ( ! $ allowed ) { return $ allowed ; } else { $ allowedAny = true ; } } } } return $ allowedAny ; }
Search ACEs associated with parent roles of specified role for pemissions granted to the specified resource.

If any of the parent roles has explicitly revoked access right to the specified resource then this method returns false.
If any of parent roles has explicitly granted access right to the specified resource and none of them has it revoked then
this method returns true. Otherwise this method returns null.

@param string $roleId
@param string $resourceId
@param string $permissionId
@param array $params
@return bool|null
Search ACEs associated with parent roles of specified role for pemissions granted to the specified resource .