mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 10:49:00 +02:00
Added possibility to list all available API keys at the user settings page
This commit is contained in:
parent
040e86ea6d
commit
35a0e8464a
9 changed files with 245 additions and 42 deletions
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue