def METHOD_NAME(self):
    """
    Tests that a user cannot access an instance if they have no access to any nodegroup.
    """
    resource = ResourceInstance.objects.get(resourceinstanceid=self.resource_instance_id)
    nodes = Node.objects.filter(graph_id=resource.graph_id)
    for node in nodes:
        if node.nodegroup:
            assign_perm("no_access_to_nodegroup", self.group, node.nodegroup)
    hasperms = user_has_resource_model_permissions(self.user, ["models.read_nodegroup"], resource)
    self.assertTrue(hasperms is False)