|
@@ -555,7 +555,9 @@ auto ViewService::SettingsToJson(const ViewSettings& settings) -> nlohmann::json
|
|
|
{"show_in_sidebar", settings.show_in_sidebar},
|
|
{"show_in_sidebar", settings.show_in_sidebar},
|
|
|
{"icon", settings.icon},
|
|
{"icon", settings.icon},
|
|
|
{"filters", settings.filters},
|
|
{"filters", settings.filters},
|
|
|
- {"sort", settings.sort}
|
|
|
|
|
|
|
+ {"sort", settings.sort},
|
|
|
|
|
+ {"visible_to_groups", settings.visible_to_groups},
|
|
|
|
|
+ {"editable_by_groups", settings.editable_by_groups}
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -566,6 +568,23 @@ auto ViewService::JsonToSettings(const nlohmann::json& json) -> ViewSettings {
|
|
|
settings.icon = json.value("icon", "");
|
|
settings.icon = json.value("icon", "");
|
|
|
settings.filters = json.value("filters", nlohmann::json::object());
|
|
settings.filters = json.value("filters", nlohmann::json::object());
|
|
|
settings.sort = json.value("sort", nlohmann::json::object());
|
|
settings.sort = json.value("sort", nlohmann::json::object());
|
|
|
|
|
+
|
|
|
|
|
+ // Parse access control arrays
|
|
|
|
|
+ if (json.contains("visible_to_groups") && json["visible_to_groups"].is_array()) {
|
|
|
|
|
+ for (const auto& group : json["visible_to_groups"]) {
|
|
|
|
|
+ if (group.is_string()) {
|
|
|
|
|
+ settings.visible_to_groups.push_back(group.get<std::string>());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (json.contains("editable_by_groups") && json["editable_by_groups"].is_array()) {
|
|
|
|
|
+ for (const auto& group : json["editable_by_groups"]) {
|
|
|
|
|
+ if (group.is_string()) {
|
|
|
|
|
+ settings.editable_by_groups.push_back(group.get<std::string>());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return settings;
|
|
return settings;
|
|
|
}
|
|
}
|
|
|
|
|
|