2019-05-09 18:54:39 +12:00
|
|
|
<?php
|
|
|
|
|
2021-01-06 01:58:16 +13:00
|
|
|
use Appwrite\Auth\Auth;
|
2019-05-09 18:54:39 +12:00
|
|
|
|
2021-01-16 21:20:59 +13:00
|
|
|
$member = [
|
2019-05-09 18:54:39 +12:00
|
|
|
'public',
|
|
|
|
'home',
|
|
|
|
'console',
|
2022-09-20 19:03:04 +12:00
|
|
|
'graphql',
|
2019-05-09 18:54:39 +12:00
|
|
|
'account',
|
|
|
|
'teams.read',
|
|
|
|
'teams.write',
|
2019-06-09 01:13:19 +12:00
|
|
|
'documents.read',
|
|
|
|
'documents.write',
|
|
|
|
'files.read',
|
|
|
|
'files.write',
|
2019-05-09 18:54:39 +12:00
|
|
|
'projects.read',
|
|
|
|
'projects.write',
|
|
|
|
'locale.read',
|
|
|
|
'avatars.read',
|
2020-12-30 20:26:01 +13:00
|
|
|
'execution.read',
|
|
|
|
'execution.write',
|
2019-05-09 18:54:39 +12:00
|
|
|
];
|
|
|
|
|
|
|
|
$admins = [
|
2022-09-20 19:03:04 +12:00
|
|
|
'graphql',
|
2020-01-12 10:53:57 +13:00
|
|
|
'teams.read',
|
|
|
|
'teams.write',
|
|
|
|
'documents.read',
|
|
|
|
'documents.write',
|
|
|
|
'files.read',
|
|
|
|
'files.write',
|
2021-06-15 19:23:06 +12:00
|
|
|
'buckets.read',
|
2021-06-15 18:38:05 +12:00
|
|
|
'buckets.write',
|
2019-05-09 18:54:39 +12:00
|
|
|
'users.read',
|
|
|
|
'users.write',
|
2022-06-22 22:51:49 +12:00
|
|
|
'databases.read',
|
|
|
|
'databases.write',
|
2019-06-09 01:13:19 +12:00
|
|
|
'collections.read',
|
|
|
|
'collections.write',
|
2019-12-16 18:11:41 +13:00
|
|
|
'platforms.read',
|
|
|
|
'platforms.write',
|
|
|
|
'keys.read',
|
|
|
|
'keys.write',
|
|
|
|
'webhooks.read',
|
|
|
|
'webhooks.write',
|
2020-01-13 00:46:39 +13:00
|
|
|
'locale.read',
|
|
|
|
'avatars.read',
|
|
|
|
'health.read',
|
2020-12-30 20:26:01 +13:00
|
|
|
'functions.read',
|
|
|
|
'functions.write',
|
|
|
|
'execution.read',
|
|
|
|
'execution.write',
|
2023-03-09 08:50:51 +13:00
|
|
|
'rules.read',
|
2023-08-10 11:12:09 +12:00
|
|
|
'rules.write',
|
2023-08-05 04:21:41 +12:00
|
|
|
'migrations.read',
|
|
|
|
'migrations.write',
|
2019-05-09 18:54:39 +12:00
|
|
|
];
|
|
|
|
|
|
|
|
return [
|
2022-08-03 21:52:04 +12:00
|
|
|
Auth::USER_ROLE_GUESTS => [
|
|
|
|
'label' => 'Guests',
|
2019-05-09 18:54:39 +12:00
|
|
|
'scopes' => [
|
2023-08-07 01:42:18 +12:00
|
|
|
'none',
|
2019-05-09 18:54:39 +12:00
|
|
|
'public',
|
|
|
|
'home',
|
|
|
|
'console',
|
2022-09-21 18:54:47 +12:00
|
|
|
'graphql',
|
2020-05-25 16:25:57 +12:00
|
|
|
'documents.read',
|
2022-08-29 17:53:37 +12:00
|
|
|
'documents.write',
|
2019-06-09 01:13:19 +12:00
|
|
|
'files.read',
|
2022-08-29 17:53:37 +12:00
|
|
|
'files.write',
|
2019-05-09 18:54:39 +12:00
|
|
|
'locale.read',
|
|
|
|
'avatars.read',
|
2022-08-29 17:53:37 +12:00
|
|
|
'execution.write',
|
2019-09-07 05:07:56 +12:00
|
|
|
],
|
2019-05-09 18:54:39 +12:00
|
|
|
],
|
2022-08-03 21:52:04 +12:00
|
|
|
Auth::USER_ROLE_USERS => [
|
|
|
|
'label' => 'Users',
|
2023-08-07 01:42:18 +12:00
|
|
|
'scopes' => \array_merge($member, [ 'none' ]),
|
2019-05-09 18:54:39 +12:00
|
|
|
],
|
2021-01-06 01:58:16 +13:00
|
|
|
Auth::USER_ROLE_ADMIN => [
|
2019-05-09 18:54:39 +12:00
|
|
|
'label' => 'Admin',
|
2023-08-07 01:42:18 +12:00
|
|
|
'scopes' => \array_merge($admins, [ 'none' ]),
|
2019-05-09 18:54:39 +12:00
|
|
|
],
|
2021-01-06 01:58:16 +13:00
|
|
|
Auth::USER_ROLE_DEVELOPER => [
|
2019-05-09 18:54:39 +12:00
|
|
|
'label' => 'Developer',
|
2023-08-07 01:42:18 +12:00
|
|
|
'scopes' => \array_merge($admins, [ 'none' ]),
|
2019-05-09 18:54:39 +12:00
|
|
|
],
|
2021-01-06 01:58:16 +13:00
|
|
|
Auth::USER_ROLE_OWNER => [
|
2019-05-09 18:54:39 +12:00
|
|
|
'label' => 'Owner',
|
2023-08-07 01:42:18 +12:00
|
|
|
'scopes' => \array_merge($member, $admins, [ 'none' ]),
|
2019-05-09 18:54:39 +12:00
|
|
|
],
|
2022-08-15 19:20:10 +12:00
|
|
|
Auth::USER_ROLE_APPS => [
|
2022-08-19 20:49:13 +12:00
|
|
|
'label' => 'Applications',
|
2023-08-07 01:42:18 +12:00
|
|
|
'scopes' => ['health.read', 'graphql', 'none'],
|
2019-05-09 18:54:39 +12:00
|
|
|
],
|
2019-09-07 05:07:56 +12:00
|
|
|
];
|