mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-03 06:54:34 +02:00
Added permissions to control access to info providers and oauth tokens
This commit is contained in:
parent
7bbf612394
commit
b3b205cd6e
9 changed files with 72 additions and 1 deletions
|
@ -43,6 +43,8 @@ class OAuthClientController extends AbstractController
|
|||
#[Route('/{name}/connect', name: 'oauth_client_connect')]
|
||||
public function connect(string $name): Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted('@system.manage_oauth_tokens');
|
||||
|
||||
return $this->clientRegistry
|
||||
->getClient($name) // key used in config/packages/knpu_oauth2_client.yaml
|
||||
->redirect();
|
||||
|
@ -51,6 +53,8 @@ class OAuthClientController extends AbstractController
|
|||
#[Route('/{name}/check', name: 'oauth_client_check')]
|
||||
public function check(string $name, Request $request): Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted('@system.manage_oauth_tokens');
|
||||
|
||||
$client = $this->clientRegistry->getClient($name);
|
||||
|
||||
$access_token = $client->getAccessToken();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue