Beispiel #1
0
 def has_private_access(self):
     if self.request.user and self.request.user.is_authenticated:
         return is_member_of(self.request.user, self.get_group())
     else:
         return False
Beispiel #2
0
def is_member_of_associated_group(user, content):
    for group in content.get_associated_groups():
        if memberships.is_member_of(user, group):
            return True
    return False
Beispiel #3
0
 def check_authorization(self, authenticated_gestalt):
     return ((authenticated_gestalt is not None)
             and is_member_of(authenticated_gestalt.user, self.get_group()))
def is_member_of_any_content_group(user, content):
    for group in content.groups.all():
        if memberships.is_member_of(user, group):
            return True
    return False
def gestalt_is_member_of(user, group_gestalt):
    group, gestalt = group_gestalt
    return memberships.is_member_of(gestalt.user, group)
def is_member(user, association):
    if association.entity.is_group:
        return memberships.is_member_of(user, association.entity)
    else:
        return user.gestalt == association.entity
Beispiel #7
0
 def has_private_access(self):
     if self.request.user and self.request.user.is_authenticated:
         return is_member_of(self.request.user, self.get_group())
     else:
         return False
Beispiel #8
0
 def check_authorization(self, authenticated_gestalt):
     return ((authenticated_gestalt is not None)
             and is_member_of(authenticated_gestalt.user, self.get_group()))
def gestalt_is_member_of(user, group_gestalt):
    group, gestalt = group_gestalt
    return memberships.is_member_of(gestalt.user, group)
def is_member(user, association):
    if association.entity.is_group:
        return memberships.is_member_of(user, association.entity)
    else:
        return user.gestalt == association.entity