2019-05-09 06:54:39 +00:00
|
|
|
<?php
|
|
|
|
|
|
2021-01-05 12:58:16 +00:00
|
|
|
use Appwrite\Auth\Auth;
|
2019-05-09 06:54:39 +00:00
|
|
|
|
2021-01-16 08:20:59 +00:00
|
|
|
$member = [
|
2019-05-09 06:54:39 +00:00
|
|
|
'public',
|
|
|
|
|
'home',
|
|
|
|
|
'console',
|
|
|
|
|
'account',
|
|
|
|
|
'teams.read',
|
|
|
|
|
'teams.write',
|
2019-06-08 13:13:19 +00:00
|
|
|
'documents.read',
|
|
|
|
|
'documents.write',
|
|
|
|
|
'files.read',
|
|
|
|
|
'files.write',
|
2019-05-09 06:54:39 +00:00
|
|
|
'projects.read',
|
|
|
|
|
'projects.write',
|
|
|
|
|
'locale.read',
|
|
|
|
|
'avatars.read',
|
2020-12-30 07:26:01 +00:00
|
|
|
'execution.read',
|
|
|
|
|
'execution.write',
|
2019-05-09 06:54:39 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
$admins = [
|
2020-01-11 21:53:57 +00:00
|
|
|
'teams.read',
|
|
|
|
|
'teams.write',
|
|
|
|
|
'documents.read',
|
|
|
|
|
'documents.write',
|
|
|
|
|
'files.read',
|
|
|
|
|
'files.write',
|
2019-05-09 06:54:39 +00:00
|
|
|
'users.read',
|
|
|
|
|
'users.write',
|
2019-06-08 13:13:19 +00:00
|
|
|
'collections.read',
|
|
|
|
|
'collections.write',
|
2019-12-16 05:11:41 +00:00
|
|
|
'platforms.read',
|
|
|
|
|
'platforms.write',
|
|
|
|
|
'keys.read',
|
|
|
|
|
'keys.write',
|
|
|
|
|
'tasks.read',
|
|
|
|
|
'tasks.write',
|
|
|
|
|
'webhooks.read',
|
|
|
|
|
'webhooks.write',
|
2020-01-12 11:46:39 +00:00
|
|
|
'locale.read',
|
|
|
|
|
'avatars.read',
|
|
|
|
|
'health.read',
|
2020-12-30 07:26:01 +00:00
|
|
|
'functions.read',
|
|
|
|
|
'functions.write',
|
|
|
|
|
'execution.read',
|
|
|
|
|
'execution.write',
|
2019-05-09 06:54:39 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
return [
|
2021-01-05 12:58:16 +00:00
|
|
|
Auth::USER_ROLE_GUEST => [
|
2019-05-09 06:54:39 +00:00
|
|
|
'label' => 'Guest',
|
|
|
|
|
'scopes' => [
|
|
|
|
|
'public',
|
|
|
|
|
'home',
|
|
|
|
|
'console',
|
2020-05-25 04:25:57 +00:00
|
|
|
'documents.read',
|
2019-06-08 13:13:19 +00:00
|
|
|
'files.read',
|
2019-05-09 06:54:39 +00:00
|
|
|
'locale.read',
|
|
|
|
|
'avatars.read',
|
2020-12-30 07:26:01 +00:00
|
|
|
'execution.read',
|
|
|
|
|
'execution.write',
|
2019-09-06 17:07:56 +00:00
|
|
|
],
|
2019-05-09 06:54:39 +00:00
|
|
|
],
|
2021-01-05 12:58:16 +00:00
|
|
|
Auth::USER_ROLE_MEMBER => [
|
2019-05-09 06:54:39 +00:00
|
|
|
'label' => 'Member',
|
2021-01-16 08:20:59 +00:00
|
|
|
'scopes' => \array_merge($member, []),
|
2019-05-09 06:54:39 +00:00
|
|
|
],
|
2021-01-05 12:58:16 +00:00
|
|
|
Auth::USER_ROLE_ADMIN => [
|
2019-05-09 06:54:39 +00:00
|
|
|
'label' => 'Admin',
|
2020-06-20 11:20:49 +00:00
|
|
|
'scopes' => \array_merge($admins, []),
|
2019-05-09 06:54:39 +00:00
|
|
|
],
|
2021-01-05 12:58:16 +00:00
|
|
|
Auth::USER_ROLE_DEVELOPER => [
|
2019-05-09 06:54:39 +00:00
|
|
|
'label' => 'Developer',
|
2020-06-20 11:20:49 +00:00
|
|
|
'scopes' => \array_merge($admins, []),
|
2019-05-09 06:54:39 +00:00
|
|
|
],
|
2021-01-05 12:58:16 +00:00
|
|
|
Auth::USER_ROLE_OWNER => [
|
2019-05-09 06:54:39 +00:00
|
|
|
'label' => 'Owner',
|
2021-01-16 08:20:59 +00:00
|
|
|
'scopes' => \array_merge($member, $admins, []),
|
2019-05-09 06:54:39 +00:00
|
|
|
],
|
2021-01-05 12:58:16 +00:00
|
|
|
Auth::USER_ROLE_APP => [
|
2019-05-09 06:54:39 +00:00
|
|
|
'label' => 'Application',
|
2020-01-12 15:20:51 +00:00
|
|
|
'scopes' => ['health.read'],
|
2019-05-09 06:54:39 +00:00
|
|
|
],
|
2019-09-06 17:07:56 +00:00
|
|
|
];
|