1
0
Fork 0
mirror of synced 2024-06-02 10:54:44 +12:00

Synced scopes

This commit is contained in:
Eldad Fux 2019-12-16 07:11:41 +02:00
parent 69633e81c8
commit ef3545cb75
5 changed files with 34 additions and 1203 deletions

View file

@ -33,6 +33,14 @@ $admins = [
'users.write',
'collections.read',
'collections.write',
'platforms.read',
'platforms.write',
'keys.read',
'keys.write',
'tasks.read',
'tasks.write',
'webhooks.read',
'webhooks.write',
];
return [

22
app/config/scopes.php Normal file
View file

@ -0,0 +1,22 @@
<?php
return [ // List of publicly visible scopes
'users.read',
'users.write',
'teams.read',
'teams.write',
'collections.read',
'collections.write',
'documents.read',
'documents.write',
'files.read',
'files.write',
'platforms.read',
'platforms.write',
'keys.read',
'keys.write',
'tasks.read',
'tasks.write',
'webhooks.read',
'webhooks.write',
];;

View file

@ -13,18 +13,7 @@ use Database\Validator\UID;
include_once '../shared/api.php';
$scopes = [ // TODO sync with console UI list
'users.read',
'users.write',
'teams.read',
'teams.write',
'collections.read',
'collections.write',
'documents.read',
'documents.write',
'files.read',
'files.write',
];
$scopes = include __DIR__.'/../../../app/config/scopes.php';
$utopia->get('/v1/keys')
->desc('List Keys')

File diff suppressed because it is too large Load diff

View file

@ -140,8 +140,11 @@ $utopia->get('/console/keys')
->label('permission', 'public')
->label('scope', 'console')
->action(function () use ($layout) {
$scopes = include __DIR__.'/../../../app/config/scopes.php';
$page = new View(__DIR__.'/../views/console/keys/index.phtml');
$page->setParam('scopes', $scopes);
$layout
->setParam('title', APP_NAME.' - API Keys')
->setParam('body', $page);