- First commit
This commit is contained in:
commit
2845badd40
5 files changed
+124
No files matched your search
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Taxus;
|
||||
|
||||
trait UserEntityTrait
|
||||
{
|
||||
public ? Taxus $taxus;
|
||||
|
||||
public function can(string $privilegeName, ...$arguments) : bool
|
||||
{
|
||||
if (! $this->taxus) {
|
||||
throw new \Exception("An instance of Taxus must be linked to this object.");
|
||||
}
|
||||
|
||||
return $this->taxus->granted($privilegeName, ...$arguments);
|
||||
}
|
||||
|
||||
public function cannot(string $privilegeName, ...$arguments) : bool
|
||||
{
|
||||
return ! $this->can($privilegeName, ...$arguments);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user