From d93fb23bba357cd94181dccf52cd08c6262e8063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Ma=C3=AFzi?= Date: Tue, 29 Sep 2020 09:52:20 +0200 Subject: [PATCH] [0.2.1] Allows route parameters without acls. The route is deactivated. --- halfapi/__init__.py | 2 +- halfapi/lib/routes.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/halfapi/__init__.py b/halfapi/__init__.py index cc15c38..c99244d 100644 --- a/halfapi/__init__.py +++ b/halfapi/__init__.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -__version__ = '0.2.0' +__version__ = '0.2.1' def version(): return f'HalfAPI version:{__version__}' diff --git a/halfapi/lib/routes.py b/halfapi/lib/routes.py index 6450462..38ee11a 100644 --- a/halfapi/lib/routes.py +++ b/halfapi/lib/routes.py @@ -44,7 +44,7 @@ def route_acl_decorator(fct: Callable, acls_mod, params: List[Dict]): @wraps(fct) async def caller(req: Request, *args, **kwargs): for param in params: - if param['acl'](req, *args, **kwargs): + if param.get('acl') and param['acl'](req, *args, **kwargs): """ We merge the 'acl' and 'keys' kwargs values to let the decorated function know which ACL function answered