2022-06-22 13:31:41 +02:00
import { FromSchema } from 'json-schema-to-ts' ;
2022-06-22 14:55:43 +02:00
export const permissionSchema = {
$id : '#/components/schemas/permissionSchema' ,
2022-06-22 13:31:41 +02:00
type : 'object' ,
additionalProperties : false ,
2022-06-22 14:55:43 +02:00
required : [ 'permission' ] ,
2023-07-06 15:27:43 +02:00
description : 'Project and environment permissions' ,
2022-06-22 13:31:41 +02:00
properties : {
2022-06-22 14:55:43 +02:00
permission : {
2023-07-06 15:27:43 +02:00
description :
'[Project](https://docs.getunleash.io/reference/rbac#project-permissions) or [environment](https://docs.getunleash.io/reference/rbac#environment-permissions) permission name' ,
2022-06-22 13:31:41 +02:00
type : 'string' ,
2023-07-06 15:27:43 +02:00
example : 'UPDATE_FEATURE_STRATEGY' ,
2022-06-22 13:31:41 +02:00
} ,
2022-06-22 14:55:43 +02:00
project : {
2023-07-06 15:27:43 +02:00
description : 'The project this permission applies to' ,
2022-06-22 13:31:41 +02:00
type : 'string' ,
2023-07-06 15:27:43 +02:00
example : 'my-project' ,
2022-06-22 13:31:41 +02:00
} ,
2022-06-22 14:55:43 +02:00
environment : {
2023-07-06 15:27:43 +02:00
description : 'The environment this permission applies to' ,
2022-06-22 13:31:41 +02:00
type : 'string' ,
2023-07-06 15:27:43 +02:00
example : 'development' ,
2022-06-22 13:31:41 +02:00
} ,
} ,
components : { } ,
} as const ;
2022-06-22 14:55:43 +02:00
export type PermissionSchema = FromSchema < typeof permissionSchema > ;