diff --git a/halfapi/lib/domain.py b/halfapi/lib/domain.py index 942495d..29ddcdc 100644 --- a/halfapi/lib/domain.py +++ b/halfapi/lib/domain.py @@ -125,6 +125,7 @@ def gen_router_routes(m_router: ModuleType, path: List[str]) -> Generator: if not hasattr(m_router, 'ROUTES'): logger.error(f'Missing *ROUTES* constant in *{m_router.__name__}*') + raise Exception(f'No ROUTES constant for {m_router.__name__}') routes = m_router.ROUTES diff --git a/halfapi/lib/routes.py b/halfapi/lib/routes.py index c65c788..0f21f3d 100644 --- a/halfapi/lib/routes.py +++ b/halfapi/lib/routes.py @@ -48,6 +48,8 @@ def route_acl_decorator(fct: Callable, params: List[Dict]): logger.debug(f'ACL OK for current route ({fct} - {param.get("acl")})') + req.scope['acl_pass'] = param['acl'].__name__ + return await fct( req, *args, **{