30 lines
690 B
TypeScript
30 lines
690 B
TypeScript
import type { Permission } from './permissions';
|
|
import { ALL_PERMISSIONS } from './permissions';
|
|
|
|
export const ROLES = {
|
|
admin: {
|
|
name: 'Admin',
|
|
description: 'Full access to the organization',
|
|
permissions: ALL_PERMISSIONS,
|
|
},
|
|
user: {
|
|
name: 'User',
|
|
description: 'Limited access, must be granted server-specific permissions',
|
|
permissions: [
|
|
'server.read',
|
|
'console.read',
|
|
'files.read',
|
|
'backup.create',
|
|
'backup.download',
|
|
'schedule.read',
|
|
'plugin.read',
|
|
'config.read',
|
|
'power.start',
|
|
'power.stop',
|
|
'power.restart',
|
|
] as Permission[],
|
|
},
|
|
} as const;
|
|
|
|
export type Role = keyof typeof ROLES;
|