diff --git a/nerm/openapi.yaml b/nerm/openapi.yaml index 3e9563e5..d461ac3d 100644 --- a/nerm/openapi.yaml +++ b/nerm/openapi.yaml @@ -43,6 +43,9 @@ paths: # System Roles /system_roles: $ref: "./paths/system_roles.yaml" +# System Role Permissions + /system_role_permissions: + $ref: "./paths/system_role_permissions.yaml" # Permissions /permissions: $ref: "./paths/permissions.yaml" diff --git a/nerm/paths/system_role_permissions.yaml b/nerm/paths/system_role_permissions.yaml new file mode 100644 index 00000000..4c4b2582 --- /dev/null +++ b/nerm/paths/system_role_permissions.yaml @@ -0,0 +1,15 @@ +post: + summary: Create a system role permission + description: This endpoint can create system role permissions for Lifecycle System Roles + operationId: createSystemRolePermission + tags: + - system role permissions + requestBody: + $ref: "../requestBodies/POST/SystemRolePermissions.yaml" + responses: + '200': + $ref: "../responses/SystemRolePermission.yaml" + '400': + $ref: "../responses/400.yaml" + '500': + $ref: "../responses/500.yaml" \ No newline at end of file diff --git a/nerm/requestBodies/POST/SystemRolePermissions.yaml b/nerm/requestBodies/POST/SystemRolePermissions.yaml new file mode 100644 index 00000000..5e9f08ca --- /dev/null +++ b/nerm/requestBodies/POST/SystemRolePermissions.yaml @@ -0,0 +1,9 @@ +required: true +content: + application/json: + schema: + type: object + properties: + system_role_permission: + type: object + $ref: "../../schemas/POST/SystemRolePermission.yaml" \ No newline at end of file diff --git a/nerm/responses/SystemRolePermission.yaml b/nerm/responses/SystemRolePermission.yaml new file mode 100644 index 00000000..676f7090 --- /dev/null +++ b/nerm/responses/SystemRolePermission.yaml @@ -0,0 +1,9 @@ +description: Expected response to a valid request +content: + application/json: + schema: + type: object + properties: + system_role_permission: + type: object + $ref: '../schemas/GET/SystemRolePermission.yaml' \ No newline at end of file diff --git a/nerm/schemas/GET/SystemRolePermission.yaml b/nerm/schemas/GET/SystemRolePermission.yaml new file mode 100644 index 00000000..91513ef3 --- /dev/null +++ b/nerm/schemas/GET/SystemRolePermission.yaml @@ -0,0 +1,28 @@ +type: object +properties: + id: + type: string + format: uuid + readOnly: true + description: The id of the system role permission + example: 2e06b876-f456-473d-bd65-b6435e0b6b2d + system_role_id: + type: string + format: uuid + description: The id of the system role + example: ef5d413f-ba18-49e6-9a72-bb115aa133ff + value: + type: integer + format: int32 + example: 1 + description: The permissions level of access + subject: + type: integer + format: int32 + example: 1 + description: The type of permission + subject_id: + type: string + format: uuid + example: db3d85ef-c324-458b-b206-58debaa96419 + description: The ID of the object that the permission is giving access to \ No newline at end of file diff --git a/nerm/schemas/POST/SystemRolePermission.yaml b/nerm/schemas/POST/SystemRolePermission.yaml new file mode 100644 index 00000000..76fe3a22 --- /dev/null +++ b/nerm/schemas/POST/SystemRolePermission.yaml @@ -0,0 +1,24 @@ +type: object +properties: + system_role_id: + type: string + format: uuid + description: The id of the system role + example: ef5d413f-ba18-49e6-9a72-bb115aa133ff + subject_id: + type: string + format: uuid + example: db3d85ef-c324-458b-b206-58debaa96419 + description: The ID of the object that the permission is giving access to + value: + type: integer + format: int32 + enum: [1, 2, 3, 4, 5, 6, 7] + example: 1 + description: The permissions level of access + subject: + type: integer + format: int32 + enum: [0, 2, 14] + example: 0 + description: The type of permission \ No newline at end of file