From 4eb23fd189b42e12f271720f77954f3abd574d65 Mon Sep 17 00:00:00 2001 From: "Maxime Alves LIRMM@home" Date: Thu, 22 Apr 2021 17:30:21 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20l'option=20"check"=20permettant=20?= =?UTF-8?q?de=20conna=C3=AEtre=20l'acl=20qui=20passe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- halfapi/lib/routes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/halfapi/lib/routes.py b/halfapi/lib/routes.py index c9da4b8..0c0be13 100644 --- a/halfapi/lib/routes.py +++ b/halfapi/lib/routes.py @@ -8,7 +8,7 @@ from types import ModuleType, FunctionType from starlette.exceptions import HTTPException from starlette.routing import Route from starlette.requests import Request -from starlette.responses import Response +from starlette.responses import Response, PlainTextResponse from halfapi.lib.domain import gen_domain_routes, VERBS @@ -52,6 +52,9 @@ def route_acl_decorator(fct: Callable, params: List[Dict]): req.scope['acl_pass'] = param['acl'].__name__ + if 'check' in req.query_params: + return PlainTextResponse(param['acl'].__name__) + return await fct( req, *args, **{