Merge branch 'acl_connected'

This commit is contained in:
Maxime Alves LIRMM 2020-07-01 10:15:52 +02:00
commit ea6d50cd13
1 changed files with 11 additions and 0 deletions

View File

@ -2,6 +2,17 @@
class BaseACL:
""" Base ACL class that contains generic methods for domains ACL
"""
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
return caller
def public(self, *args) -> bool:
"Unlimited access"