From daebce503e2d2dbe503fd31ae46cd3c373a555a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Livia=20K=C3=BCnzli?= Date: Wed, 7 May 2025 11:03:05 +0200 Subject: [PATCH] Remove duplicate in validations.md --- extending/validations.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/extending/validations.md b/extending/validations.md index d48f628..3a1f074 100644 --- a/extending/validations.md +++ b/extending/validations.md @@ -1,8 +1,6 @@ # Validations -The main group of the user By default, Caluma assumes the first group in the list of groups it receives from the OIDC provider as the group the request was made in the name of. This means, this group will be written into the created\_by\_group field on the records that get created during the request. It is possible to manually set this group in the validation class, in order to override this behavior: from caluma.caluma\_core.validations import BaseValidation - -class CustomValidation(BaseValidation): def validate(self, mutation, data, info): # the list of groups received from the OIDC provider can be accessed with # info.context.user.groups # Overriding the main group can be achieved by setting the `group` property on the user object: info.context.user.group = "foobar" return dataValidation classes can validate or amend input data of any mutation. Each mutation is processed in two steps: +Validation classes can validate or amend input data of any mutation. Each mutation is processed in two steps: 1. Permission classes check if a given mutation is allowed based on the object being mutated, and 2. Validation classes process (and potentially amend) input data of a given mutation