mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 15:23:12 +08:00
Created specs for API key roles
This commit is contained in:
@@ -11,6 +11,7 @@ use Happyr\DoctrineSpecification\Spec;
|
||||
use Happyr\DoctrineSpecification\Specification\Specification;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
use Shlinkio\Shlink\Common\Entity\AbstractEntity;
|
||||
use Shlinkio\Shlink\Rest\ApiKey\Role;
|
||||
|
||||
class ApiKey extends AbstractEntity
|
||||
{
|
||||
@@ -69,6 +70,7 @@ class ApiKey extends AbstractEntity
|
||||
|
||||
public function spec(): Specification
|
||||
{
|
||||
return Spec::andX();
|
||||
$specs = $this->roles->map(fn (ApiKeyRole $role) => Role::toSpec($role));
|
||||
return Spec::andX(...$specs);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user