From 7dd7d0062529ea5955b6047ae575f9203a50bc22 Mon Sep 17 00:00:00 2001 From: "Maxime Alves LIRMM@home" Date: Tue, 17 May 2022 16:13:33 +0200 Subject: [PATCH] [halfdomain] fix last modification --- halfapi/half_domain.py | 10 +++++----- halfapi/halfapi.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/halfapi/half_domain.py b/halfapi/half_domain.py index 2901463..22b01df 100644 --- a/halfapi/half_domain.py +++ b/halfapi/half_domain.py @@ -96,21 +96,21 @@ class HalfDomain(Starlette): @staticmethod - def acls(domain): + def acls(domain, acl=None): """ Returns the ACLS constant for the given domain """ - m_acl = HalfDomain.m_acl(domain) + m_acl = HalfDomain.m_acl(domain, acl) try: return getattr(m_acl, 'ACLS') except AttributeError: raise Exception(f'Missing acl.ACLS constant in {domain} module') @staticmethod - def acls_route(domain): + def acls_route(domain, acl=None): d_res = {} - m_acl = HalfDomain.m_acl(domain) + m_acl = HalfDomain.m_acl(domain, acl) - for acl_name, doc, order in HalfDomain.acls(domain): + for acl_name, doc, order in HalfDomain.acls(domain, acl): fct = getattr(m_acl, acl_name) d_res[acl_name] = { 'callable': fct, diff --git a/halfapi/halfapi.py b/halfapi/halfapi.py index a35a995..31e3e8c 100644 --- a/halfapi/halfapi.py +++ b/halfapi/halfapi.py @@ -209,7 +209,7 @@ class HalfAPI(Starlette): def acls_route(self): res = { - domain: HalfDomain.acls_route(domain) + domain: HalfDomain.acls_route(domain, domain_conf.get('acl')) for domain, domain_conf in self.config.get('domain', {}).items() if isinstance(domain_conf, dict) and domain_conf.get('enabled', False) }