private boolean includeInstance(String viewName, String version, String instanceName, boolean readOnly) {

    ViewRegistry viewRegistry = ViewRegistry.getInstance();

    return viewRegistry.checkPermission(viewName, version, instanceName, readOnly);
  }
Determine whether or not the view instance resource identified
by the given instance name should be included based on the permissions
granted to the current user.

@param viewName      the view name
@param version       the view version
@param instanceName  the name of the view instance resource
@param readOnly      indicate whether or not this is for a read only operation

@return true if the view instance should be included based on the permissions of the current user
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ViewInstanceResourceProvider.java