2023-06-19 10:41:40 +02:00
|
|
|
import {
|
|
|
|
ROOT_PERMISSION_TYPE,
|
|
|
|
PROJECT_PERMISSION_TYPE,
|
|
|
|
ENVIRONMENT_PERMISSION_TYPE,
|
|
|
|
} from '@server/util/constants';
|
|
|
|
|
|
|
|
export type PermissionType =
|
|
|
|
| typeof ROOT_PERMISSION_TYPE
|
|
|
|
| typeof PROJECT_PERMISSION_TYPE
|
|
|
|
| typeof ENVIRONMENT_PERMISSION_TYPE;
|
|
|
|
|
2023-06-14 15:40:40 +02:00
|
|
|
export interface IPermission {
|
|
|
|
name: string;
|
|
|
|
displayName: string;
|
2023-06-19 10:41:40 +02:00
|
|
|
type: PermissionType;
|
2023-06-14 15:40:40 +02:00
|
|
|
environment?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IPermissions {
|
|
|
|
root: IPermission[];
|
|
|
|
project: IPermission[];
|
|
|
|
environments: IProjectEnvironmentPermissions[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IProjectEnvironmentPermissions {
|
|
|
|
name: string;
|
|
|
|
permissions: IPermission[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ICheckedPermissions {
|
|
|
|
[key: string]: IPermission;
|
|
|
|
}
|
2023-06-19 10:41:40 +02:00
|
|
|
|
|
|
|
export interface IPermissionCategory {
|
|
|
|
label: string;
|
|
|
|
type: PermissionType;
|
|
|
|
permissions: IPermission[];
|
|
|
|
}
|
2024-02-16 14:31:33 +01:00
|
|
|
|
|
|
|
export interface IMatrixPermission extends IPermission {
|
|
|
|
hasPermission: boolean;
|
|
|
|
}
|