60 lines
1.6 KiB
TypeScript
60 lines
1.6 KiB
TypeScript
export const PERMISSIONS = {
|
|
// Server
|
|
'server.create': 'Create servers',
|
|
'server.read': 'View servers',
|
|
'server.update': 'Update server settings',
|
|
'server.delete': 'Delete servers',
|
|
|
|
// Console
|
|
'console.read': 'View console output',
|
|
'console.write': 'Send console commands',
|
|
|
|
// Files
|
|
'files.read': 'View and download files',
|
|
'files.write': 'Create, edit, and upload files',
|
|
'files.delete': 'Delete files',
|
|
'files.archive': 'Compress and decompress files',
|
|
|
|
// Backup
|
|
'backup.read': 'View backups',
|
|
'backup.create': 'Create backups',
|
|
'backup.restore': 'Restore backups',
|
|
'backup.delete': 'Delete backups',
|
|
'backup.download': 'Download backups',
|
|
'backup.manage': 'Lock and manage backups',
|
|
|
|
// Schedule
|
|
'schedule.read': 'View scheduled tasks',
|
|
'schedule.manage': 'Create, edit, and delete scheduled tasks',
|
|
|
|
// Subuser
|
|
'subuser.read': 'View subusers',
|
|
'subuser.manage': 'Create, edit, and delete subusers',
|
|
|
|
// Plugin
|
|
'plugin.read': 'View installed plugins',
|
|
'plugin.manage': 'Install and remove plugins',
|
|
|
|
// Config
|
|
'config.read': 'View server config',
|
|
'config.write': 'Edit server config',
|
|
|
|
// Power
|
|
'power.start': 'Start server',
|
|
'power.stop': 'Stop server',
|
|
'power.restart': 'Restart server',
|
|
'power.kill': 'Kill server',
|
|
|
|
// Node (org admin)
|
|
'node.read': 'View nodes',
|
|
'node.manage': 'Manage nodes and allocations',
|
|
|
|
// Organization
|
|
'org.settings': 'Manage organization settings',
|
|
'org.members': 'Manage organization members',
|
|
} as const;
|
|
|
|
export type Permission = keyof typeof PERMISSIONS;
|
|
|
|
export const ALL_PERMISSIONS = Object.keys(PERMISSIONS) as Permission[];
|