@@ -639,26 +639,43 @@ private void scanToNormalizeValues(String path, JsonElement parent, String name,
639639 message .add ("room" , GsonFactory .createSnakeCase ().toJsonTree (SampleObjects .Room ));
640640 }
641641 }
642- if (name != null && name .equals ("permissions" ) && path .equals ("/api/admin.functions.permissions.lookup" )) {
643- JsonObject permissions = element .getAsJsonObject ();
644- try {
645- // To avoid concurrent modification of the underlying objects
646- List <String > oldKeys = new ArrayList <>();
647- permissions .keySet ().iterator ().forEachRemaining (oldKeys ::add );
648- for (String key : oldKeys ) {
649- permissions .remove (key );
650- }
642+ if (name != null && path .equals ("/api/admin.functions.permissions.lookup" )) {
643+ if (name .equals ("permissions" )) {
644+ JsonObject permissions = element .getAsJsonObject ();
645+ try {
646+ // To avoid concurrent modification of the underlying objects
647+ List <String > oldKeys = new ArrayList <>();
648+ permissions .keySet ().iterator ().forEachRemaining (oldKeys ::add );
649+ for (String key : oldKeys ) {
650+ permissions .remove (key );
651+ }
651652
652- } catch (Exception e ) {
653- log .error (e .getMessage (), e );
653+ } catch (Exception e ) {
654+ log .error (e .getMessage (), e );
655+ }
656+ AppFunctionPermissions appFunctionPermissions = new AppFunctionPermissions ();
657+ appFunctionPermissions .setDistribution (initProperties (new AppFunctionPermissions .Distribution ()));
658+ appFunctionPermissions .setAllowedEntities (initProperties (new AppFunctionPermissions .AllowedEntities ()));
659+ appFunctionPermissions .setAllowedByAdmin (initProperties (new AppFunctionPermissions .AllowedByAdmin ()));
660+ JsonObject p = GsonFactory .createSnakeCase ().toJsonTree (appFunctionPermissions ).getAsJsonObject ();
661+ permissions .add ("Fn0000000000" , p );
662+ permissions .add ("Fn0000000000_" , p );
663+ } else if (name .equals ("metadata" )) {
664+ JsonObject metadata = element .getAsJsonObject ();
665+ try {
666+ // To avoid concurrent modification of the underlying objects
667+ List <String > oldKeys = new ArrayList <>();
668+ metadata .keySet ().iterator ().forEachRemaining (oldKeys ::add );
669+ for (String key : oldKeys ) {
670+ metadata .remove (key );
671+ }
672+ } catch (Exception e ) {
673+ log .error (e .getMessage (), e );
674+ }
675+ JsonObject obj = GsonFactory .createSnakeCase ().toJsonTree (new Object ()).getAsJsonObject ();
676+ metadata .add ("Fn0000000000" , obj );
677+ metadata .add ("Fn0000000000_" , obj );
654678 }
655- AppFunctionPermissions appFunctionPermissions = new AppFunctionPermissions ();
656- appFunctionPermissions .setDistribution (initProperties (new AppFunctionPermissions .Distribution ()));
657- appFunctionPermissions .setAllowedEntities (initProperties (new AppFunctionPermissions .AllowedEntities ()));
658- appFunctionPermissions .setAllowedByAdmin (initProperties (new AppFunctionPermissions .AllowedByAdmin ()));
659- JsonObject p = GsonFactory .createSnakeCase ().toJsonTree (appFunctionPermissions ).getAsJsonObject ();
660- permissions .add ("Fn0000000000" , p );
661- permissions .add ("Fn0000000000_" , p );
662679 }
663680 if (name != null && name .equals ("prefs" ) && path .equals ("/api/admin.conversations.getConversationPrefs" )) {
664681 JsonObject prefs = element .getAsJsonObject ();
0 commit comments