src/Permissions/AbstractPermission.php
protected function resolve(Lock $lock, $action, Resource $resource = null)
    {
        // If no resource was set for this permission we'll only need to check the action.
        if ($this->resource === null || $this->resource->getResourceType() === null) {
            return $this->matchesAction($action) && $this->resolveConditions($lock, $action, $resource);
        }

        return (
            $this->matchesAction($action) &&
            $this->matchesResource($resource) &&
            $this->resolveConditions($lock, $action, $resource)
        );
    }
protected function resolve(Lock $lock, $action, Resource $resource = null)
    {
        // If no resource was set for this permission we'll only need to check the action.
        if ($this->resource === null || $this->resource->getResourceType() === null) {
            return $this->matchesAction($action) && $this->resolveConditions($lock, $action, $resource);
        }

        return (
            $this->matchesAction($action) &&
            $this->matchesResource($resource) &&
            $this->resolveConditions($lock, $action, $resource)
        );
    }
protected function resolve ( Lock $ lock , $ action , Resource $ resource = null ) { // If no resource was set for this permission we'll only need to check the action. if ( $ this -> resource === null || $ this -> resource -> getResourceType ( ) === null ) { return $ this -> matchesAction ( $ action ) && $ this -> resolveConditions ( $ lock , $ action , $ resource ) ; } return ( $ this -> matchesAction ( $ action ) && $ this -> matchesResource ( $ resource ) && $ this -> resolveConditions ( $ lock , $ action , $ resource ) ) ; }
Validate a permission against the given params.

@param \BeatSwitch\Lock\Lock $lock
@param string $action
@param \BeatSwitch\Lock\Resources\Resource|null $resource
@return bool
Validate a permission against the given params .