public boolean includeDefinition(ViewEntity definitionEntity) {

    if (checkPermission(null, false)) {
      return true;
    }

    for (ViewInstanceEntity instanceEntity : definitionEntity.getInstances()) {
      if (checkPermission(instanceEntity, true)) {
        return true;
      }
    }
    return false;
  }
Determine whether or not the given view definition resource should be included
based on the permissions granted to the current user.

@param definitionEntity the view definition entity
@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/view/ViewRegistry.java