private boolean checkAuthorization(ResourceEntity resourceEntity) {
    Long resourceId = (resourceEntity == null) ? null : resourceEntity.getId();

    return (resourceId == null)
        ? AuthorizationHelper.isAuthorized(ResourceType.AMBARI, null, RoleAuthorization.AMBARI_MANAGE_VIEWS)
        : AuthorizationHelper.isAuthorized(ResourceType.VIEW, resourceId, RoleAuthorization.VIEW_USE);
  }
Sync given view with data in DB. Ensures that view data in DB is updated,
all instances changes from xml config are reflected to DB

@param view                view config from xml
@param instanceDefinitions view instances from xml
@throws Exception if the view can not be synced
ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java