Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function evaluate(Subject $subject, Resource $resource, array $params)
 {
     if (!$resource instanceof Book) {
         return false;
     }
     return $resource->getAuthorId() === $subject->getSubjectId();
 }
Exemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function deleteAssignment(Subject $subject)
 {
     $assignment = $this->overseer->getAssignment($subject->getSubjectId(), $subject->getSubjectName());
     if ($assignment instanceof Assignment) {
         $this->overseer->deleteAssignment($assignment);
     }
 }
Exemplo n.º 3
0
 /**
  * @param Subject $subject
  *
  * @return Assignment|null
  */
 public function getAssignmentForSubject(Subject $subject)
 {
     return $this->assignmentStorage->getAssignment($subject->getSubjectId(), $subject->getSubjectName());
 }