Skip to content
Snippets Groups Projects
Commit 211aef3d authored by Valentin Rigal's avatar Valentin Rigal
Browse files

Fixes

parent 7444d87c
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,8 @@ class ACLMixin(object):
"""
Access control mixin using the generic Right table.
"""
self._user = None
def __init__(self, user=None):
self._user = user
......@@ -33,7 +35,9 @@ class ACLMixin(object):
# Handle special authentications
if level <= Role.Guest.value and getattr(instance, 'public', False):
return True
if self.user.is_admin or self.user.is_internal:
if self.user.is_anonymous:
return False
elif self.user.is_admin or self.user.is_internal:
return True
return instance.memberships.filter(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment