summaryrefslogtreecommitdiff
path: root/src/components/policy/policy_external/include/policy/policy_helper.h
diff options
context:
space:
mode:
authorAKalinich-Luxoft <AKalinich@luxoft.com>2017-09-26 15:00:32 +0300
committerAKalinich-Luxoft <AKalinich@luxoft.com>2017-09-27 12:26:46 +0300
commitbfdcdd0f21dc83ffb8a607060d3392cad10406a4 (patch)
tree5da5ce3d356affed546283084ca90c4b18536128 /src/components/policy/policy_external/include/policy/policy_helper.h
parentb99b6f58762c20f0018faa1fa9f23d568675b92c (diff)
downloadsdl_core-bfdcdd0f21dc83ffb8a607060d3392cad10406a4.tar.gz
Fix PTU applying for default app policy section
There was a problem with applying changes for applications which is registered with "default" policies and this policy group was updated after PTU. In this case permissions for already registered applications which is using these groups still have permissions as before update. Also default policy section was not updated after PTU with changes in this section. This issue is reproduced on EXTERNAL_PROPRIETARY flow only. To fix this issue there was removed code in CacheManager, which incorrectly assigns default policies to apps with "default" policies. Also there was a redundant code because default policies is unwrapped in PTU before its applying, so all specific application policies is already have actual new default policy permissions. In this case it is correct to assign to every app his own policies from PTU. Also there was updated logic in ProcessAppPolicyCheckResults() to perform all needed actions once per app, because its possible that results could contain sever results for one app_id.
Diffstat (limited to 'src/components/policy/policy_external/include/policy/policy_helper.h')
-rw-r--r--src/components/policy/policy_external/include/policy/policy_helper.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/components/policy/policy_external/include/policy/policy_helper.h b/src/components/policy/policy_external/include/policy/policy_helper.h
index 42c1ec0b46..6945f45b45 100644
--- a/src/components/policy/policy_external/include/policy/policy_helper.h
+++ b/src/components/policy/policy_external/include/policy/policy_helper.h
@@ -199,6 +199,23 @@ struct CheckAppPolicy {
CheckAppPolicyResults& out_results_;
};
+/**
+ * @brief Helper struct for filling actions to be done for processed application
+ * using CheckAppPolicyResults data as a source
+ */
+struct FillActionsForAppPolicies {
+ FillActionsForAppPolicies(
+ ApplicationsPoliciesActions& actions,
+ const policy_table::ApplicationPolicies& app_policies)
+ : actions_(actions), app_policies_(app_policies) {}
+
+ void operator()(const policy::CheckAppPolicyResults::value_type& value);
+
+ private:
+ ApplicationsPoliciesActions& actions_;
+ const policy_table::ApplicationPolicies& app_policies_;
+};
+
/*
* @brief Fill permissions data with merged rpc permissions for hmi levels and
* parameters