- Now allowing privilege from enums
This commit is contained in:
1 parent
c5a42a9093
commit
3e684fbd81
2 files changed
+3
-1
No files matched your search
@@ -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 ?");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user