コード例 #1
0
 public function __construct(RoleInterface $role, ResourceInterface $resource, $action, $existingRole)
 {
     parent::__construct("Access for '{$role->getName()}' to '{$action}' '{$resource->getClass()}' with ID '{$resource->getId()}'  is already granted by the '{$existingRole}' role.");
 }
コード例 #2
0
 /**
  * Convenience method that defers to the 'withName' method.
  *
  * @see self::hasRoleWithName
  *
  * @param RoleInterface $role
  *
  * @return bool
  */
 public function hasRole(RoleInterface $role) : bool
 {
     return $this->hasRoleWithName($role->getName());
 }