

def has_generic_permission(self, request, permission_type):
    "\n        Return true if the current user has permission on this\n        image. Return the string 'ALL' if the user has all rights.\n        "
    user = request.user
    if (not user.is_authenticated()):
        return False
    elif permission_type.is_superuser:
        return True
    elif (user == self.owner):
        return True
    elif self.folder:
        return self.folder.has_generic_permission(request, permission_type)
    else:
        return False

dataset/ETHPy150Open django-leonardo/django-leonardo/leonardo/module/media/models/abstract.py BaseImage.has_generic_permission/VarMisuse@39/98 `user`->`permission_type`