Device.{BBF_VENDOR_PREFIX}URLFilter.Profile.{i}.Name: update permission

This commit is contained in:
Amin Ben Ramdhane 2022-06-15 09:50:14 +00:00
parent 7f306cbede
commit b36eca90a7
3 changed files with 18 additions and 4 deletions

View file

@ -1296,6 +1296,19 @@ static void uci_set_value(json_object *mapping_obj, int json_version, char *refp
char uci_type[32] = {0}; char uci_type[32] = {0};
snprintf(uci_type, sizeof(uci_type), "@%s[%ld]", json_object_get_string(type), instance ? DM_STRTOL(instance)-1 : 0); snprintf(uci_type, sizeof(uci_type), "@%s[%ld]", json_object_get_string(type), instance ? DM_STRTOL(instance)-1 : 0);
if (strcmp(opt_temp, "@Name") == 0) {
struct uci_section *dmmap_section = NULL;
char buf[64] = {0};
snprintf(buf, sizeof(buf), "dmmap_%s", json_object_get_string(file));
get_dmmap_section_of_config_section(buf, json_object_get_string(type), section_name((struct uci_section *)data), &dmmap_section);
dmuci_set_value_by_section(dmmap_section, "section_name", value);
dmuci_rename_section(json_object_get_string(file), uci_type, value);
return;
}
if (option) { if (option) {
if (linker_jobj) if (linker_jobj)
adm_entry_get_linker_value(ctx, value, &linker); adm_entry_get_linker_value(ctx, value, &linker);

View file

@ -338,6 +338,7 @@ int dmuci_add_list_value(char *package, char *section, char *option, char *value
int dmuci_del_list_value(char *package, char *section, char *option, char *value); int dmuci_del_list_value(char *package, char *section, char *option, char *value);
int dmuci_add_section(char *package, char *stype, struct uci_section **s); int dmuci_add_section(char *package, char *stype, struct uci_section **s);
int dmuci_delete(char *package, char *section, char *option, char *value); int dmuci_delete(char *package, char *section, char *option, char *value);
int dmuci_rename_section(char *package, char *section, char *value);
int dmuci_get_value_by_section_string(struct uci_section *s, char *option, char **value); int dmuci_get_value_by_section_string(struct uci_section *s, char *option, char **value);
char *dmuci_get_value_by_section_fallback_def(struct uci_section *s, char *option, char *default_value); char *dmuci_get_value_by_section_fallback_def(struct uci_section *s, char *option, char *default_value);
int dmuci_get_value_by_section_list(struct uci_section *s, char *option, struct uci_list **value); int dmuci_get_value_by_section_list(struct uci_section *s, char *option, struct uci_list **value);

View file

@ -128,14 +128,14 @@
"section": { "section": {
"type": "profile" "type": "profile"
}, },
"dmmapfile": "dmmap_urlfilter_profile" "dmmapfile": "dmmap_urlfilter"
} }
} }
], ],
"Name": { "Name": {
"type": "string", "type": "string",
"read": true, "read": true,
"write": false, "write": true,
"version": "2.14", "version": "2.14",
"protocols": [ "protocols": [
"cwmp", "cwmp",
@ -155,7 +155,7 @@
"section": { "section": {
"type": "profile" "type": "profile"
}, },
"list": { "option": {
"name": "@Name" "name": "@Name"
} }
} }
@ -258,7 +258,7 @@
"section": { "section": {
"type": "filter" "type": "filter"
}, },
"dmmapfile": "dmmap_urlfilter_filter" "dmmapfile": "dmmap_urlfilter"
} }
} }
], ],