public boolean checkPermission(ViewInstanceEntity instanceEntity, boolean readOnly) {

    ResourceEntity resourceEntity = instanceEntity == null ? null : instanceEntity.getResource();

    return (resourceEntity == null && readOnly) || checkAuthorization(resourceEntity);
  }
Determine whether or not access to the given view instance should be allowed 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 access to the view instance is allowed
ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java