can($privilege, ...$arguments) ) { return true; } } return false; } public function can(string $privilegeName, ...$arguments) : bool { if (! $this->taxus) { throw new \Exception("An instance of Taxus must be linked to this object."); } $grant = $this->taxus->granted($privilegeName, ...$arguments); return is_bool($grant) ? $grant : $grant === TaxusGrantEnum::Authorized; } public function cannot(string $privilegeName, ...$arguments) : bool { return ! $this->can($privilegeName, ...$arguments); } }