From 01c2e4669a548572ddc03e8da628edc146d2d0f6 Mon Sep 17 00:00:00 2001 From: Laurent LAPORTE Date: Thu, 8 Feb 2024 08:37:30 +0100 Subject: [PATCH] docs: improve docstring description in `assert_permission` --- antarest/study/storage/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/antarest/study/storage/utils.py b/antarest/study/storage/utils.py index b23d10333a..a0fc7a02fe 100644 --- a/antarest/study/storage/utils.py +++ b/antarest/study/storage/utils.py @@ -230,7 +230,12 @@ def assert_permission( permission_type: level of permission raising: raise error if permission not matched - Returns: true if permission match, false if not raising. + Returns: + `True` if the user has the required permissions, `False` otherwise. + + Raises: + `UserHasNotPermissionError`: If the raising parameter is set to `True` + and the user does not have the required permissions. """ studies = [study] if study else [] return assert_permission_on_studies(user, studies, permission_type, raising=raising)