private boolean includeInstance(ViewInstanceEntity instanceEntity, boolean readOnly) {

    ViewRegistry viewRegistry = ViewRegistry.getInstance();

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

@param instanceEntity  the view instance entity
@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