2019-05-09 06:54:39 +00:00
|
|
|
<?php
|
|
|
|
|
|
2025-11-04 06:08:35 +00:00
|
|
|
use Appwrite\Utopia\Database\Documents\User;
|
2019-05-09 06:54:39 +00:00
|
|
|
|
2021-01-16 08:20:59 +00:00
|
|
|
$member = [
|
2023-09-07 04:57:23 +00:00
|
|
|
'global',
|
2019-05-09 06:54:39 +00:00
|
|
|
'public',
|
|
|
|
|
'home',
|
|
|
|
|
'console',
|
2022-09-20 07:03:04 +00:00
|
|
|
'graphql',
|
2024-01-17 11:17:03 +00:00
|
|
|
'sessions.write',
|
2024-02-20 11:45:11 +00:00
|
|
|
'account',
|
2019-05-09 06:54:39 +00:00
|
|
|
'teams.read',
|
|
|
|
|
'teams.write',
|
2019-06-08 13:13:19 +00:00
|
|
|
'documents.read',
|
|
|
|
|
'documents.write',
|
2025-06-25 05:59:45 +00:00
|
|
|
'rows.read',
|
|
|
|
|
'rows.write',
|
2019-06-08 13:13:19 +00:00
|
|
|
'files.read',
|
|
|
|
|
'files.write',
|
2019-05-09 06:54:39 +00:00
|
|
|
'projects.read',
|
|
|
|
|
'locale.read',
|
|
|
|
|
'avatars.read',
|
2020-12-30 07:26:01 +00:00
|
|
|
'execution.read',
|
|
|
|
|
'execution.write',
|
2023-09-12 15:33:44 +00:00
|
|
|
'targets.read',
|
|
|
|
|
'targets.write',
|
|
|
|
|
'subscribers.write',
|
2023-09-13 20:43:27 +00:00
|
|
|
'subscribers.read',
|
2023-09-05 13:55:13 +00:00
|
|
|
'assistant.read',
|
2025-07-29 10:16:56 +00:00
|
|
|
'rules.read',
|
2019-05-09 06:54:39 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
$admins = [
|
2023-09-07 04:57:23 +00:00
|
|
|
'global',
|
2022-09-20 07:03:04 +00:00
|
|
|
'graphql',
|
2024-01-17 11:17:03 +00:00
|
|
|
'sessions.write',
|
2020-01-11 21:53:57 +00:00
|
|
|
'teams.read',
|
|
|
|
|
'teams.write',
|
|
|
|
|
'documents.read',
|
|
|
|
|
'documents.write',
|
2025-06-25 05:59:45 +00:00
|
|
|
'rows.read',
|
|
|
|
|
'rows.write',
|
2020-01-11 21:53:57 +00:00
|
|
|
'files.read',
|
|
|
|
|
'files.write',
|
2021-06-15 07:23:06 +00:00
|
|
|
'buckets.read',
|
2021-06-15 06:38:05 +00:00
|
|
|
'buckets.write',
|
2019-05-09 06:54:39 +00:00
|
|
|
'users.read',
|
|
|
|
|
'users.write',
|
2022-06-22 10:51:49 +00:00
|
|
|
'databases.read',
|
|
|
|
|
'databases.write',
|
2019-06-08 13:13:19 +00:00
|
|
|
'collections.read',
|
|
|
|
|
'collections.write',
|
2025-06-25 05:59:45 +00:00
|
|
|
'tables.read',
|
|
|
|
|
'tables.write',
|
2019-12-16 05:11:41 +00:00
|
|
|
'platforms.read',
|
|
|
|
|
'platforms.write',
|
2024-09-05 03:47:58 +00:00
|
|
|
'projects.write',
|
2019-12-16 05:11:41 +00:00
|
|
|
'keys.read',
|
|
|
|
|
'keys.write',
|
2025-12-18 11:31:00 +00:00
|
|
|
'devKeys.read',
|
|
|
|
|
'devKeys.write',
|
2019-12-16 05:11:41 +00:00
|
|
|
'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',
|
2024-10-26 09:01:14 +00:00
|
|
|
'sites.read',
|
|
|
|
|
'sites.write',
|
2024-11-29 13:27:10 +00:00
|
|
|
'log.read',
|
|
|
|
|
'log.write',
|
2020-12-30 07:26:01 +00:00
|
|
|
'execution.read',
|
|
|
|
|
'execution.write',
|
2023-03-08 19:50:51 +00:00
|
|
|
'rules.read',
|
2023-08-09 23:12:09 +00:00
|
|
|
'rules.write',
|
2023-08-04 16:21:41 +00:00
|
|
|
'migrations.read',
|
|
|
|
|
'migrations.write',
|
2023-08-30 18:44:33 +00:00
|
|
|
'vcs.read',
|
|
|
|
|
'vcs.write',
|
2023-09-12 15:33:44 +00:00
|
|
|
'targets.read',
|
|
|
|
|
'targets.write',
|
|
|
|
|
'providers.write',
|
|
|
|
|
'providers.read',
|
|
|
|
|
'messages.write',
|
|
|
|
|
'messages.read',
|
|
|
|
|
'topics.write',
|
|
|
|
|
'topics.read',
|
|
|
|
|
'subscribers.write',
|
2024-09-01 10:13:06 +00:00
|
|
|
'subscribers.read',
|
2024-11-18 08:52:16 +00:00
|
|
|
'tokens.read',
|
|
|
|
|
'tokens.write',
|
2019-05-09 06:54:39 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
return [
|
2025-11-04 06:08:35 +00:00
|
|
|
User::ROLE_GUESTS => [
|
2022-08-03 09:52:04 +00:00
|
|
|
'label' => 'Guests',
|
2019-05-09 06:54:39 +00:00
|
|
|
'scopes' => [
|
2023-09-07 16:00:53 +00:00
|
|
|
'global',
|
2019-05-09 06:54:39 +00:00
|
|
|
'public',
|
|
|
|
|
'home',
|
|
|
|
|
'console',
|
2022-09-21 06:54:47 +00:00
|
|
|
'graphql',
|
2024-01-17 11:17:03 +00:00
|
|
|
'sessions.write',
|
2020-05-25 04:25:57 +00:00
|
|
|
'documents.read',
|
2022-08-29 05:53:37 +00:00
|
|
|
'documents.write',
|
2025-06-25 05:59:45 +00:00
|
|
|
'rows.read',
|
|
|
|
|
'rows.write',
|
2019-06-08 13:13:19 +00:00
|
|
|
'files.read',
|
2022-08-29 05:53:37 +00:00
|
|
|
'files.write',
|
2019-05-09 06:54:39 +00:00
|
|
|
'locale.read',
|
|
|
|
|
'avatars.read',
|
2022-08-29 05:53:37 +00:00
|
|
|
'execution.write',
|
2019-09-06 17:07:56 +00:00
|
|
|
],
|
2019-05-09 06:54:39 +00:00
|
|
|
],
|
2025-11-04 06:08:35 +00:00
|
|
|
User::ROLE_USERS => [
|
2022-08-03 09:52:04 +00:00
|
|
|
'label' => 'Users',
|
2023-08-20 12:14:05 +00:00
|
|
|
'scopes' => \array_merge($member),
|
2019-05-09 06:54:39 +00:00
|
|
|
],
|
2025-11-04 06:08:35 +00:00
|
|
|
User::ROLE_ADMIN => [
|
2019-05-09 06:54:39 +00:00
|
|
|
'label' => 'Admin',
|
2023-08-20 12:14:05 +00:00
|
|
|
'scopes' => \array_merge($admins),
|
2019-05-09 06:54:39 +00:00
|
|
|
],
|
2025-11-04 06:08:35 +00:00
|
|
|
User::ROLE_DEVELOPER => [
|
2019-05-09 06:54:39 +00:00
|
|
|
'label' => 'Developer',
|
2023-08-20 12:14:05 +00:00
|
|
|
'scopes' => \array_merge($admins),
|
2019-05-09 06:54:39 +00:00
|
|
|
],
|
2025-11-04 06:08:35 +00:00
|
|
|
User::ROLE_OWNER => [
|
2019-05-09 06:54:39 +00:00
|
|
|
'label' => 'Owner',
|
2023-08-20 12:14:05 +00:00
|
|
|
'scopes' => \array_merge($member, $admins),
|
2019-05-09 06:54:39 +00:00
|
|
|
],
|
2025-11-04 06:08:35 +00:00
|
|
|
User::ROLE_APPS => [
|
2022-08-19 08:49:13 +00:00
|
|
|
'label' => 'Applications',
|
2023-12-11 20:56:59 +00:00
|
|
|
'scopes' => ['global', 'health.read', 'graphql'],
|
2019-05-09 06:54:39 +00:00
|
|
|
],
|
2019-09-06 17:07:56 +00:00
|
|
|
];
|