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."); }
/** * 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()); }