mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 09:13:11 +08:00
Added a system to set roles to API keys
This commit is contained in:
31
module/Rest/src/Entity/ApiKeyRole.php
Normal file
31
module/Rest/src/Entity/ApiKeyRole.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Shlinkio\Shlink\Rest\Entity;
|
||||
|
||||
use Shlinkio\Shlink\Common\Entity\AbstractEntity;
|
||||
|
||||
class ApiKeyRole extends AbstractEntity
|
||||
{
|
||||
private string $roleName;
|
||||
private array $meta;
|
||||
private ApiKey $apiKey;
|
||||
|
||||
public function __construct(string $roleName, array $meta, ApiKey $apiKey)
|
||||
{
|
||||
$this->roleName = $roleName;
|
||||
$this->meta = $meta;
|
||||
$this->apiKey = $apiKey;
|
||||
}
|
||||
|
||||
public function name(): string
|
||||
{
|
||||
return $this->roleName;
|
||||
}
|
||||
|
||||
public function meta(): array
|
||||
{
|
||||
return $this->meta;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user