[0.2.1] Allows route parameters without acls. The route is deactivated.

This commit is contained in:
Joël Maïzi 2020-09-29 09:52:20 +02:00
parent 3530f53820
commit d93fb23bba
2 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
__version__ = '0.2.0' __version__ = '0.2.1'
def version(): def version():
return f'HalfAPI version:{__version__}' return f'HalfAPI version:{__version__}'

View File

@ -44,7 +44,7 @@ def route_acl_decorator(fct: Callable, acls_mod, params: List[Dict]):
@wraps(fct) @wraps(fct)
async def caller(req: Request, *args, **kwargs): async def caller(req: Request, *args, **kwargs):
for param in params: 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 We merge the 'acl' and 'keys' kwargs values to let the
decorated function know which ACL function answered decorated function know which ACL function answered