2020-05-19 18:10:39 -04:00
|
|
|
export default function(server) {
|
|
|
|
|
|
2020-06-18 14:22:31 -04:00
|
|
|
// Scope resources
|
2020-06-04 16:53:37 -04:00
|
|
|
|
2020-08-17 14:43:12 -04:00
|
|
|
// creates a global scope
|
|
|
|
|
const globalScope = server.create('scope', {
|
|
|
|
|
id: 'global',
|
|
|
|
|
type: 'global',
|
|
|
|
|
name: 'Global'
|
|
|
|
|
});
|
2020-07-29 13:13:43 -04:00
|
|
|
const orgScope = server.createList('scope', 3, {
|
2020-07-24 16:11:26 -04:00
|
|
|
type: 'org',
|
|
|
|
|
scope: { id: globalScope.id, type: globalScope.type }
|
2020-07-29 13:13:43 -04:00
|
|
|
}, 'withChildren')[0];
|
2020-06-18 15:51:40 -04:00
|
|
|
|
|
|
|
|
// Auth
|
2020-10-26 11:17:03 -04:00
|
|
|
server.createList('auth-method', 1, { scope: globalScope }, 'withAccountsAndUsers');
|
2020-09-30 10:45:39 -04:00
|
|
|
server.createList('auth-method', 3, { scope: orgScope }, 'withAccountsAndUsers');
|
2020-05-19 18:10:39 -04:00
|
|
|
|
2020-09-01 12:03:36 -04:00
|
|
|
// Groups and Users
|
2020-10-26 11:17:03 -04:00
|
|
|
server.createList('group', 1, { scope: globalScope }, 'withMembers');
|
2020-09-09 16:24:48 -04:00
|
|
|
server.createList('group', 5, { scope: orgScope }, 'withMembers');
|
2020-08-12 13:41:23 -04:00
|
|
|
// Role
|
2020-10-26 11:17:03 -04:00
|
|
|
server.createList('role', 1, { scope: globalScope }, 'withPrincipals');
|
2020-09-10 11:03:44 -04:00
|
|
|
server.createList('role', 5, { scope: orgScope }, 'withPrincipals');
|
2020-06-22 21:39:38 -04:00
|
|
|
|
2020-06-18 14:22:31 -04:00
|
|
|
// Other resources
|
2020-09-04 08:41:28 -04:00
|
|
|
server.schema.scopes.where({type: 'project'}).models.forEach(scope => {
|
2020-09-10 16:19:27 -04:00
|
|
|
server.createList('host-catalog', 2, { scope }, 'withChildren');
|
2020-08-25 15:45:51 -04:00
|
|
|
server.createList('target', 2, { scope }, 'withRandomHostSets');
|
2020-09-18 12:54:31 -04:00
|
|
|
server.createList('session', 4, { scope }, 'withAssociations');
|
2020-07-28 11:06:06 -04:00
|
|
|
});
|
2020-08-25 11:54:36 -04:00
|
|
|
|
2020-05-19 18:10:39 -04:00
|
|
|
}
|