summaryrefslogtreecommitdiff
path: root/src/components/policy/policy_external/src/sql_pt_ext_representation.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/policy/policy_external/src/sql_pt_ext_representation.cc')
-rw-r--r--src/components/policy/policy_external/src/sql_pt_ext_representation.cc22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/components/policy/policy_external/src/sql_pt_ext_representation.cc b/src/components/policy/policy_external/src/sql_pt_ext_representation.cc
index f58a7f0b82..5bb602244e 100644
--- a/src/components/policy/policy_external/src/sql_pt_ext_representation.cc
+++ b/src/components/policy/policy_external/src/sql_pt_ext_representation.cc
@@ -670,6 +670,11 @@ bool SQLPTExtRepresentation::SaveApplicationPoliciesSection(
return false;
}
+ if (!query_delete.Exec(sql_pt::kDeleteRequestSubType)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from request subtype.");
+ return false;
+ }
+
// First, all predefined apps (e.g. default, pre_DataConsent) should be saved,
// otherwise another app with the predefined permissions can get incorrect
// permissions
@@ -713,18 +718,17 @@ bool SQLPTExtRepresentation::SaveSpecificAppPolicy(
if (!SetDefaultPolicy(app.first)) {
return false;
}
- if (!SaveRequestType(app.first, *app.second.RequestType)) {
- return false;
- }
} else if (kPreDataConsentId.compare(app.second.get_string()) == 0) {
if (!SetPredataPolicy(app.first)) {
return false;
}
- if (!SaveRequestType(app.first, *app.second.RequestType)) {
- return false;
- }
}
-
+ if (!SaveRequestType(app.first, *app.second.RequestType)) {
+ return false;
+ }
+ if (!SaveRequestSubType(app.first, *app.second.RequestSubType)) {
+ return false;
+ }
// Stop saving other params, since predefined permissions already set
return true;
}
@@ -771,6 +775,10 @@ bool SQLPTExtRepresentation::SaveSpecificAppPolicy(
return false;
}
+ if (!SaveRequestSubType(app.first, *app.second.RequestSubType)) {
+ return false;
+ }
+
return true;
}