1
0
Fork 0
mirror of synced 2024-05-25 15:09:47 +12:00
appwrite/app/config/roles.php

88 lines
1.8 KiB
PHP
Raw Normal View History

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',
'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',
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',
Database layer (#3338) * database response model * database collection config * new database scopes * database service update * database execption codes * remove read write permission from database model * updating tests and fixing some bugs * server side tests are now passing * databases api * tests for database endpoint * composer update * fix error * formatting * formatting fixes * get database test * more updates to events and usage * more usage updates * fix delete type * fix test * delete database * more fixes * databaseId in attributes and indexes * more fixes * fix issues * fix index subquery * fix console scope and index query * updating tests as required * fix phpcs errors and warnings * updates to review suggestions * UI progress * ui updates and cleaning up * fix type * rework database events * update tests * update types * event generation fixed * events config updated * updating context to support multiple * realtime updates * fix ids * update context * validator updates * fix naming conflict * fix tests * fix lint errors * fix wprler and realtime tests * fix webhooks test * fix event validator and other tests * formatting fixes * removing leftover var_dumps * remove leftover comment * update usage params * usage metrics updates * update database usage * fix usage * specs update * updates to usage * fix UI and usage * fix lints * internal id fixes * fixes for internal Id * renaming services and related files * rename tests * rename doc link * rename readme * fix test name * tests: fixes for 0.15.x sync Co-authored-by: Torsten Dittmann <torsten.dittmann@googlemail.com>
2022-06-22 22:51:49 +12:00
'databases.read',
'databases.write',
'collections.read',
'collections.write',
2019-12-16 18:11:41 +13:00
'platforms.read',
'platforms.write',
'keys.read',
'keys.write',
'webhooks.read',
'webhooks.write',
'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',
'documents.read',
'files.read',
2019-05-09 18:54:39 +12:00
'locale.read',
'avatars.read',
],
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
],
];