'Return true if the current user has permission on this
image. Return the string \'ALL\' if the user has all rights.'

def has_generic_permission(self, request, permission_type):

    user = request.user
    if (not user.is_authenticated()):
        return False
    elif user.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
