@Override
      public Void invoke() throws AmbariException, AuthorizationException {
        boolean isUserAdministrator = AuthorizationHelper.isAuthorized(ResourceType.AMBARI, null,
            RoleAuthorization.AMBARI_MANAGE_USERS);

        for (Map<String, Object> propertyMap : propertyMaps) {
          // Ensure that the authenticated user has authorization to get this information
          final String userName = getUserName(propertyMap);
          if (!isUserAdministrator && !AuthorizationHelper.getAuthenticatedName().equalsIgnoreCase(userName)) {
            throw new AuthorizationException();
          }

          Set<HashMap<String, String>> widgetLayouts = (Set) propertyMap.get(WIDGETLAYOUT);
          for (HashMap<String, String> widgetLayout : widgetLayouts) {
            final Long layoutId;
            try {
              layoutId = Long.parseLong(widgetLayout.get(ID));
            } catch (Exception ex) {
              throw new AmbariException("WidgetLayout should have numerical id");
            }
            final WidgetLayoutEntity entity = widgetLayoutDAO.findById(layoutId);
            if (entity == null) {
              throw new AmbariException("There is no widget layout with id " + layoutId);
            }
          }
          UserEntity user = userDAO.findUserByName(userName);
          user.setActiveWidgetLayouts(gson.toJson(propertyMap.get(WIDGETLAYOUT)));
          userDAO.merge(user);
        }
        return null;
      }
Returns the response for the active widget layout that should be returned for the active widget layout REST endpoint
@param layoutEntity {@link WidgetLayoutEntity}
@return  {@link ActiveWidgetLayoutResponse}
@throws SystemException
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ActiveWidgetLayoutResourceProvider.java