Change how API keys are validated (#771)
This commit is contained in:
parent
df7a857929
commit
285485d7b0
24 changed files with 774 additions and 383 deletions
|
@ -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 a new issue