- Now allowing privilege from enums

This commit is contained in:
mcndave committed 2023-11-03 08:27:53 -04:00
1 parent c5a42a9093
commit 3e684fbd81
2 files changed
+3 -1

No files matched your search

+2
View File
@@ -34,6 +34,8 @@ class Taxus
public function granted($name, ...$arguments) : bool
{
$name = $name instanceof \BackedEnum ? $name->value : $name;
if ( ! isset($this->list[$name]) ) {
throw new \InvalidArgumentException("Privilege '{$name}' could not be found. Did you forgot to add it to your Taxus object ?");
}