misc_pterodactyl-panel/app/Models/ApiKey.php

35 lines
962 B
PHP
Raw Normal View History

2016-01-16 00:26:50 +00:00
<?php
2016-12-07 22:46:38 +00:00
2016-01-16 00:26:50 +00:00
namespace Pterodactyl\Models;
use Pterodactyl\Services\Acl\Api\AdminAcl;
2016-01-16 00:26:50 +00:00
class ApiKey extends Model
2016-01-16 00:26:50 +00:00
{
2018-01-14 18:11:04 +00:00
/**
* Different API keys that can exist on the system.
*/
2021-01-23 20:33:34 +00:00
public const TYPE_ACCOUNT = 1;
public const TYPE_APPLICATION = 2;
2016-01-16 00:26:50 +00:00
/**
* Cast values to correct type.
*
* @var array
*/
protected $casts = [
2020-03-28 23:06:36 +00:00
'allowed_ips' => 'array',
'user_id' => 'int',
'r_' . AdminAcl::RESOURCE_USERS => 'int',
'r_' . AdminAcl::RESOURCE_ALLOCATIONS => 'int',
'r_' . AdminAcl::RESOURCE_DATABASE_HOSTS => 'int',
'r_' . AdminAcl::RESOURCE_SERVER_DATABASES => 'int',
'r_' . AdminAcl::RESOURCE_EGGS => 'int',
'r_' . AdminAcl::RESOURCE_LOCATIONS => 'int',
'r_' . AdminAcl::RESOURCE_NESTS => 'int',
'r_' . AdminAcl::RESOURCE_NODES => 'int',
'r_' . AdminAcl::RESOURCE_SERVERS => 'int',
'r_' . AdminAcl::RESOURCE_ROLES => 'int',
];
2016-01-16 00:26:50 +00:00
}