2019-05-09 18:54:39 +12:00
|
|
|
<?php
|
|
|
|
|
2019-09-07 05:07:56 +12:00
|
|
|
const ROLE_GUEST = 0;
|
|
|
|
const ROLE_MEMBER = 1;
|
|
|
|
const ROLE_ADMIN = 2;
|
|
|
|
const ROLE_DEVELOPER = 3;
|
|
|
|
const ROLE_OWNER = 4;
|
|
|
|
const ROLE_APP = 5;
|
|
|
|
const ROLE_SYSTEM = 6;
|
|
|
|
const ROLE_ALL = '*';
|
2019-05-09 18:54:39 +12:00
|
|
|
|
|
|
|
$logged = [
|
|
|
|
'public',
|
|
|
|
'home',
|
|
|
|
'console',
|
|
|
|
'auth',
|
|
|
|
'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',
|
|
|
|
'health.read',
|
|
|
|
];
|
|
|
|
|
|
|
|
$admins = [
|
|
|
|
'users.read',
|
|
|
|
'users.write',
|
2019-06-09 01:13:19 +12:00
|
|
|
'collections.read',
|
|
|
|
'collections.write',
|
2019-05-09 18:54:39 +12:00
|
|
|
];
|
|
|
|
|
|
|
|
return [
|
2019-09-07 05:07:56 +12:00
|
|
|
ROLE_GUEST => [
|
2019-05-09 18:54:39 +12:00
|
|
|
'label' => 'Guest',
|
|
|
|
'scopes' => [
|
|
|
|
'public',
|
|
|
|
'home',
|
|
|
|
'console',
|
|
|
|
'auth',
|
2019-06-09 01:13:19 +12:00
|
|
|
'files.read',
|
2019-05-09 18:54:39 +12:00
|
|
|
'locale.read',
|
|
|
|
'avatars.read',
|
|
|
|
'health.read',
|
2019-09-07 05:07:56 +12:00
|
|
|
],
|
2019-05-09 18:54:39 +12:00
|
|
|
],
|
2019-09-07 05:07:56 +12:00
|
|
|
ROLE_MEMBER => [
|
2019-05-09 18:54:39 +12:00
|
|
|
'label' => 'Member',
|
2019-09-07 05:07:56 +12:00
|
|
|
'scopes' => array_merge($logged, []),
|
2019-05-09 18:54:39 +12:00
|
|
|
],
|
2019-09-07 05:07:56 +12:00
|
|
|
ROLE_ADMIN => [
|
2019-05-09 18:54:39 +12:00
|
|
|
'label' => 'Admin',
|
2019-09-07 05:07:56 +12:00
|
|
|
'scopes' => array_merge($logged, $admins, []),
|
2019-05-09 18:54:39 +12:00
|
|
|
],
|
2019-09-07 05:07:56 +12:00
|
|
|
ROLE_DEVELOPER => [
|
2019-05-09 18:54:39 +12:00
|
|
|
'label' => 'Developer',
|
2019-09-07 05:07:56 +12:00
|
|
|
'scopes' => array_merge($logged, $admins, []),
|
2019-05-09 18:54:39 +12:00
|
|
|
],
|
2019-09-07 05:07:56 +12:00
|
|
|
ROLE_OWNER => [
|
2019-05-09 18:54:39 +12:00
|
|
|
'label' => 'Owner',
|
2019-09-07 05:07:56 +12:00
|
|
|
'scopes' => array_merge($logged, $admins, []),
|
2019-05-09 18:54:39 +12:00
|
|
|
],
|
2019-09-07 05:07:56 +12:00
|
|
|
ROLE_APP => [
|
2019-05-09 18:54:39 +12:00
|
|
|
'label' => 'Application',
|
2019-09-07 05:07:56 +12:00
|
|
|
'scopes' => ['public'],
|
2019-05-09 18:54:39 +12:00
|
|
|
],
|
2019-09-07 05:07:56 +12:00
|
|
|
];
|