mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-14 19:29:34 +01:00
Added possibility to list all available API keys at the user settings page
This commit is contained in:
@@ -37,10 +37,14 @@ enum ApiTokenLevel: int
|
||||
* The token can read and edit (non-sensitive) data.
|
||||
*/
|
||||
case EDIT = 2;
|
||||
/**
|
||||
* The token can do some administrative tasks (like viewing all log entries), but can not change passwords and create new tokens.
|
||||
*/
|
||||
case ADMIN = 3;
|
||||
/**
|
||||
* The token can do everything the user can do.
|
||||
*/
|
||||
case FULL = 3;
|
||||
case FULL = 4;
|
||||
|
||||
/**
|
||||
* Returns the additional roles that the authenticated user should have when using this token.
|
||||
@@ -55,4 +59,13 @@ enum ApiTokenLevel: int
|
||||
self::FULL => [self::ROLE_READ_ONLY, self::ROLE_EDIT, self::ROLE_FULL],
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the translation key for the name of this token level.
|
||||
* @return string
|
||||
*/
|
||||
public function getTranslationKey(): string
|
||||
{
|
||||
return 'api_token.level.' . strtolower($this->name);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user