mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 22:33:44 +02:00
Change how API keys are validated (#771)
This commit is contained in:
@@ -21,4 +21,20 @@ class ApiKeyRepository extends EloquentRepository implements ApiKeyRepositoryInt
|
||||
{
|
||||
return APIKey::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load permissions for a key onto the model.
|
||||
*
|
||||
* @param \Pterodactyl\Models\APIKey $model
|
||||
* @param bool $refresh
|
||||
* @return \Pterodactyl\Models\APIKey
|
||||
*/
|
||||
public function loadPermissions(APIKey $model, bool $refresh = false): APIKey
|
||||
{
|
||||
if (! $model->relationLoaded('permissions') || $refresh) {
|
||||
$model->load('permissions');
|
||||
}
|
||||
|
||||
return $model;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user