From b367f8aea0168bfc2b304a44f86c6c89783e2a5f Mon Sep 17 00:00:00 2001 From: shiva Date: Tue, 10 Mar 2026 11:47:28 +0200 Subject: [PATCH 1/2] keycloack roles for different ones --- swagger.yaml | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/swagger.yaml b/swagger.yaml index 4efd80e..e537e5d 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -774,6 +774,52 @@ paths: schema: $ref: "#/components/schemas/Error" + "/users/{userId}/job-description": + put: + operationId: updateUserJobDescription + summary: Update user job description roles + description: Updates the user's self-selected job description roles stored as a Keycloak attribute. + tags: + - Users + parameters: + - name: userId + in: path + required: true + description: The Keycloak ID of the user. + schema: + type: string + format: uuid + security: + - bearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/UpdateUserJobDescriptionRequest" + responses: + "200": + description: Job description roles updated successfully. + content: + application/json: + schema: + type: object + properties: + message: + type: string + "400": + description: Invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "default": + description: Invalid request was sent to the server. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "/users/{userId}/vacationDays": put: operationId: updateUserVacation @@ -2378,6 +2424,34 @@ components: type: integer format: int32 description: User's ID in Forecast. Used for keeping a reference of Forecast based TimeEntries and Users. + jobDescriptions: + type: array + description: User's self-selected job description roles. + items: + $ref: "#/components/schemas/JobDescriptionRole" + + JobDescriptionRole: + type: string + description: A user's self-selected job description role. + enum: + - DEVELOPER + - DESIGNER + - ARCHITECT + - ADMIN + - MANAGEMENT + - TRAINEE + + UpdateUserJobDescriptionRequest: + type: object + description: Request body for updating user job description roles. + required: + - jobDescriptions + properties: + jobDescriptions: + type: array + description: List of selected job description roles. + items: + $ref: "#/components/schemas/JobDescriptionRole" UpdateUserAttribute: type: object From a6434dc624a1d2f7cfc291a63c0936d0ee7288e4 Mon Sep 17 00:00:00 2001 From: shiva Date: Tue, 10 Mar 2026 12:11:57 +0200 Subject: [PATCH 2/2] changes made --- swagger.yaml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/swagger.yaml b/swagger.yaml index e537e5d..d0d8660 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -774,9 +774,9 @@ paths: schema: $ref: "#/components/schemas/Error" - "/users/{userId}/job-description": + "/users/{userId}/job-descriptions": put: - operationId: updateUserJobDescription + operationId: updateUserJobDescriptions summary: Update user job description roles description: Updates the user's self-selected job description roles stored as a Keycloak attribute. tags: @@ -796,7 +796,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/UpdateUserJobDescriptionRequest" + $ref: "#/components/schemas/UpdateUserJobDescriptionsRequest" responses: "200": description: Job description roles updated successfully. @@ -813,8 +813,20 @@ paths: application/json: schema: $ref: "#/components/schemas/Error" - "default": - description: Invalid request was sent to the server. + "401": + description: Unauthorized. Missing or invalid authentication token. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "403": + description: Forbidden. The authenticated user does not have permission to perform this action. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: Internal server error. content: application/json: schema: @@ -2441,7 +2453,7 @@ components: - MANAGEMENT - TRAINEE - UpdateUserJobDescriptionRequest: + UpdateUserJobDescriptionsRequest: type: object description: Request body for updating user job description roles. required: