Ejemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function evaluate(Subject $subject, Resource $resource, array $params)
 {
     if (!$resource instanceof Book) {
         return false;
     }
     return $resource->getAuthorId() === $subject->getSubjectId();
 }
Ejemplo n.º 2
0
 /**
  * @param Resource $resource
  *
  * @return bool
  */
 public function appliesToResource(Resource $resource)
 {
     return $this->resourceName === $resource->getResourceName();
 }