(user, obj, strict=False)
return access.exists()
strict=True policy ensures public projects still get their access checked.
strict=True policy ensures public projects still get their access checked.
strict = True policy ensures public projects still get their access checked .
def is_readable(user, obj, strict=False):
    """
    strict=True policy ensures public projects still get their access checked.
    """
    project = obj.project
    if project.is_public and not strict:
        return True

    if user.is_anonymous:
        return False

    query = Q(access=Access.READ_ACCESS) | Q(access=Access.WRITE_ACCESS) | Q(access=Access.SHARE_ACCESS)

    access = Access.objects.filter(query, project=project, user=user)

    return access.exists()
def is_readable ( user , obj , strict = False ) : project = obj . project if project . is_public and not strict : return True if user . is_anonymous : return False query = Q ( access = Access . READ_ACCESS ) | Q ( access = Access . WRITE_ACCESS ) | Q ( access = Access . SHARE_ACCESS ) access = Access . objects . filter ( query , project = project , user = user ) return access . exists ( )