lib/FSi/Component/ACL/ACL.php
public function isAllowed(RoleInterface $role, ResourceInterface $resource, PermissionInterface $permission, array $params = array())
    {
        $roleId = spl_object_hash($role);
        $resourceId = spl_object_hash($resource);
        $permissionId = spl_object_hash($permission);
        if (isset($this->logger)) {
            $this->logger->addRecord(Logger::INFO,
                sprintf(
                    " Start checking if role %s (class: %s) has permission %s (class: %s) to resource %s (class: %s)",
                    $this->stringify($role),
                    get_class($role),
                    $this->stringify($permission),
                    get_class($permission),
                    $this->stringify($resource),
                    get_class($resource)
                ),
                $params
            );
        }

        $allowed = $this->searchACEs($roleId, $resourceId, $permissionId, $params, 1);
        if (!isset($allowed)) {
            $allowed = $this->searchParentResourceACEs($roleId, $resourceId, $permissionId, $params, 1);
        }
        if (!isset($allowed)) {
            $allowed = $this->searchParentRoleACEs($roleId, $resourceId, $permissionId, $params, 1);
        }
        if (isset($allowed)) {
            return $allowed;
        }
        if (isset($this->logger)) {
            $this->logger->addRecord(Logger::INFO, sprintf(" Access denied because no ACE has taken any decision",
                $this->stringify($role),
                $this->stringify($permission),
                $this->stringify($resource)
            ));
        }
        return false;
    }
public function isAllowed(RoleInterface $role, ResourceInterface $resource, PermissionInterface $permission, array $params = array())
    {
        $roleId = spl_object_hash($role);
        $resourceId = spl_object_hash($resource);
        $permissionId = spl_object_hash($permission);
        if (isset($this->logger)) {
            $this->logger->addRecord(Logger::INFO,
                sprintf(
                    " Start checking if role %s (class: %s) has permission %s (class: %s) to resource %s (class: %s)",
                    $this->stringify($role),
                    get_class($role),
                    $this->stringify($permission),
                    get_class($permission),
                    $this->stringify($resource),
                    get_class($resource)
                ),
                $params
            );
        }

        $allowed = $this->searchACEs($roleId, $resourceId, $permissionId, $params, 1);
        if (!isset($allowed)) {
            $allowed = $this->searchParentResourceACEs($roleId, $resourceId, $permissionId, $params, 1);
        }
        if (!isset($allowed)) {
            $allowed = $this->searchParentRoleACEs($roleId, $resourceId, $permissionId, $params, 1);
        }
        if (isset($allowed)) {
            return $allowed;
        }
        if (isset($this->logger)) {
            $this->logger->addRecord(Logger::INFO, sprintf(" Access denied because no ACE has taken any decision",
                $this->stringify($role),
                $this->stringify($permission),
                $this->stringify($resource)
            ));
        }
        return false;
    }
public function isAllowed ( RoleInterface $ role , ResourceInterface $ resource , PermissionInterface $ permission , array $ params = array ( ) ) { $ roleId = spl_object_hash ( $ role ) ; $ resourceId = spl_object_hash ( $ resource ) ; $ permissionId = spl_object_hash ( $ permission ) ; if ( isset ( $ this -> logger ) ) { $ this -> logger -> addRecord ( Logger :: INFO , sprintf ( " Start checking if role %s (class: %s) has permission %s (class: %s) to resource %s (class: %s)" , $ this -> stringify ( $ role ) , get_class ( $ role ) , $ this -> stringify ( $ permission ) , get_class ( $ permission ) , $ this -> stringify ( $ resource ) , get_class ( $ resource ) ) , $ params ) ; } $ allowed = $ this -> searchACEs ( $ roleId , $ resourceId , $ permissionId , $ params , 1 ) ; if ( ! isset ( $ allowed ) ) { $ allowed = $ this -> searchParentResourceACEs ( $ roleId , $ resourceId , $ permissionId , $ params , 1 ) ; } if ( ! isset ( $ allowed ) ) { $ allowed = $ this -> searchParentRoleACEs ( $ roleId , $ resourceId , $ permissionId , $ params , 1 ) ; } if ( isset ( $ allowed ) ) { return $ allowed ; } if ( isset ( $ this -> logger ) ) { $ this -> logger -> addRecord ( Logger :: INFO , sprintf ( " Access denied because no ACE has taken any decision" , $ this -> stringify ( $ role ) , $ this -> stringify ( $ permission ) , $ this -> stringify ( $ resource ) ) ) ; } return false ; }
Check access right to the specified permission of the specified resource for the specified role.

This method searches ACEs directly associated with specified params. If this gives no results (grant or revoke), then it
searches ACEs up in the hierarchy tree of resources starting from the specified one. If again this gives no results, then
it searches ACEs up in the hierarchy of roles starting from specified one. If none results are found then false is
returned so the access is revoked.

@param RoleInterface $role
@param ResourceInterface $resource
@param PermissionInterface $permission
@param array $params
@return bool
Check access right to the specified permission of the specified resource for the specified role .