diff --git a/halfapi/acl.py b/halfapi/acl.py index a540d3e..c222cef 100644 --- a/halfapi/acl.py +++ b/halfapi/acl.py @@ -1,19 +1,19 @@ #!/usr/bin/env python3 -class BaseACL: - """ Base ACL class that contains generic methods for domains ACL +""" Base ACL module that contains generic functions for domains ACL +""" + +def connected(func): + """ Decorator that checks if the user object of the request has been set """ - def connected(req, func): - """ Decorator that checks if the user object of the request has been set - """ - def caller() - try: - getattr(req.user, 'is_authenticated') - return func() - except AttributeError: - return False + def caller(req, *args, **kwargs): + try: + getattr(req.user, 'is_authenticated') + return func(req, **kwargs) + except AttributeError: + return False - return caller + return caller - def public(self, *args) -> bool: - "Unlimited access" - return True +def public(*args, **kwargs) -> bool: + "Unlimited access" + return True