From 7e4436a2de75b27ce33a13dec8ffdecdb9595def Mon Sep 17 00:00:00 2001 From: "Maxime Alves LIRMM@home" Date: Tue, 25 Jan 2022 14:16:49 +0100 Subject: [PATCH] [acl] ajout du parametre "out" dans les kwargs d'une route --- halfapi/half_route.py | 2 ++ halfapi/lib/acl.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/halfapi/half_route.py b/halfapi/half_route.py index ac19101..326037a 100644 --- a/halfapi/half_route.py +++ b/halfapi/half_route.py @@ -84,6 +84,8 @@ class HalfRoute(Route): logger.debug( 'Args for current route (%s)', param.get('args')) + if 'out' in param: + req.scope['out'] = param['out'] if 'out' in param: req.scope['out'] = param['out'].copy() diff --git a/halfapi/lib/acl.py b/halfapi/lib/acl.py index 745a144..ba507e9 100644 --- a/halfapi/lib/acl.py +++ b/halfapi/lib/acl.py @@ -108,8 +108,9 @@ def args_check(fct): kwargs['data'] = data - if req.scope.get('out'): - kwargs['out'] = req.scope.get('out').copy() + out_s = req.scope.get('out') + if out_s: + kwargs['out'] = list(out_s) return await fct(req, *args, **kwargs)