- First commit

This commit is contained in:
Dave Mc Nicoll committed 2021-08-27 18:08:35 +00:00
commit 2845badd40
5 files changed
+124

No files matched your search

+22
View File
@@ -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);
}
}