mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 02:38:50 +02:00
Added permissions to control access to API and manage API tokens
This commit is contained in:
parent
be14fe548c
commit
8fe3f4cf5c
7 changed files with 60 additions and 26 deletions
|
@ -406,6 +406,8 @@ class UserSettingsController extends AbstractController
|
|||
#[Route('/api_token/create', name: 'user_api_token_create')]
|
||||
public function addApiToken(Request $request, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted('@api.manage_tokens');
|
||||
|
||||
$token = new ApiToken();
|
||||
$token->setUser($this->getUser());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue