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) }