- Added a new is method
This commit is contained in:
1 parent
ba754c6be8
commit
b20de0d44a
1 file changed
+11
@@ -6,6 +6,17 @@ trait UserEntityTrait
|
||||
{
|
||||
public ? Taxus $taxus;
|
||||
|
||||
public function is(string|array $privilegeName, ...$arguments) : bool
|
||||
{
|
||||
foreach((array) $privilegeName as $privilege) {
|
||||
if ( $this->can($privilege, ...$arguments) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function can(string $privilegeName, ...$arguments) : bool
|
||||
{
|
||||
if (! $this->taxus) {
|
||||
|
||||
Reference in new issue
Block a user