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',
|
|
|
|
'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 = [
|
2020-01-12 10:53:57 +13:00
|
|
|
'teams.read',
|
|
|
|
'teams.write',
|
|
|
|
'documents.read',
|
|
|
|
'documents.write',
|
|
|
|
'files.read',
|
|
|
|
'files.write',
|
2019-05-09 18:54:39 +12:00
|
|
|
'users.read',
|
|
|
|
'users.write',
|
2019-06-09 01:13:19 +12:00
|
|
|
'collections.read',
|
|
|
|
'collections.write',
|
2021-06-11 08:41:33 +12:00
|
|
|
'attributes.read',
|
|
|
|
'attributes.write',
|
|
|
|
'indexes.read',
|
|
|
|
'indexes.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',
|
2019-05-09 18:54:39 +12:00
|
|
|
];
|
|
|
|
|
|
|
|
return [
|
2021-01-06 01:58:16 +13:00
|
|
|
Auth::USER_ROLE_GUEST => [
|
2019-05-09 18:54:39 +12:00
|
|
|
'label' => 'Guest',
|
|
|
|
'scopes' => [
|
|
|
|
'public',
|
|
|
|
'home',
|
|
|
|
'console',
|
2020-05-25 16:25:57 +12:00
|
|
|
'documents.read',
|
2019-06-09 01:13:19 +12:00
|
|
|
'files.read',
|
2019-05-09 18:54:39 +12:00
|
|
|
'locale.read',
|
|
|
|
'avatars.read',
|
2019-09-07 05:07:56 +12:00
|
|
|
],
|
2019-05-09 18:54:39 +12:00
|
|
|
],
|
2021-01-06 01:58:16 +13:00
|
|
|
Auth::USER_ROLE_MEMBER => [
|
2019-05-09 18:54:39 +12:00
|
|
|
'label' => 'Member',
|
2021-01-16 21:20:59 +13:00
|
|
|
'scopes' => \array_merge($member, []),
|
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',
|
2020-06-20 23:20:49 +12:00
|
|
|
'scopes' => \array_merge($admins, []),
|
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',
|
2020-06-20 23:20:49 +12:00
|
|
|
'scopes' => \array_merge($admins, []),
|
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',
|
2021-01-16 21:20:59 +13:00
|
|
|
'scopes' => \array_merge($member, $admins, []),
|
2019-05-09 18:54:39 +12:00
|
|
|
],
|
2021-01-06 01:58:16 +13:00
|
|
|
Auth::USER_ROLE_APP => [
|
2019-05-09 18:54:39 +12:00
|
|
|
'label' => 'Application',
|
2020-01-13 04:20:51 +13:00
|
|
|
'scopes' => ['health.read'],
|
2019-05-09 18:54:39 +12:00
|
|
|
],
|
2019-09-07 05:07:56 +12:00
|
|
|
];
|