1
0
Fork 0
mirror of synced 2024-06-02 19:04:49 +12:00
appwrite/app/config/roles.php

84 lines
1.7 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',
2019-05-09 18:54:39 +12:00
'users.read',
'users.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
],
];