diff options
author | Jacob Keeler <jacob.keeler@livioradio.com> | 2017-10-03 10:12:41 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-03 10:12:41 -0400 |
commit | b959528de5f9a044a0eb8cbdb859b9e3178b3b86 (patch) | |
tree | 07f4a6f54130b3c2483603b4c96d2874a777e8df /src/components/policy/policy_external/src/policy_helper.cc | |
parent | ce7e33de70e7a07302676aa19aced9a7bb911de0 (diff) | |
parent | 7e1d12a8bddd9180d3c43e41911c6620b1372739 (diff) | |
download | sdl_core-b959528de5f9a044a0eb8cbdb859b9e3178b3b86.tar.gz |
Merge pull request #1779 from AKalinich-Luxoft/hotfix/fix_default_app_policies_update_after_ptu
Fix PTU applying for "default" app policies
Diffstat (limited to 'src/components/policy/policy_external/src/policy_helper.cc')
-rw-r--r-- | src/components/policy/policy_external/src/policy_helper.cc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/components/policy/policy_external/src/policy_helper.cc b/src/components/policy/policy_external/src/policy_helper.cc index 3041323489..5425777833 100644 --- a/src/components/policy/policy_external/src/policy_helper.cc +++ b/src/components/policy/policy_external/src/policy_helper.cc @@ -484,6 +484,41 @@ bool CheckAppPolicy::IsRequestTypeChanged( return diff.size(); } +void FillActionsForAppPolicies::operator()( + const policy::CheckAppPolicyResults::value_type& value) { + const std::string app_id = value.first; + const policy_table::ApplicationPolicies::const_iterator app_policy = + app_policies_.find(app_id); + + if (app_policies_.end() == app_policy) { + return; + } + + if (IsPredefinedApp(*app_policy)) { + return; + } + + switch (value.second) { + case RESULT_APP_REVOKED: + case RESULT_NICKNAME_MISMATCH: + actions_[app_id].is_notify_system = true; + return; + case RESULT_CONSENT_NEEDED: + case RESULT_PERMISSIONS_REVOKED_AND_CONSENT_NEEDED: + actions_[app_id].is_consent_needed = true; + break; + case RESULT_CONSENT_NOT_REQIURED: + case RESULT_PERMISSIONS_REVOKED: + case RESULT_REQUEST_TYPE_CHANGED: + break; + case RESULT_NO_CHANGES: + default: + return; + } + actions_[app_id].is_notify_system = true; + actions_[app_id].is_send_permissions_to_app = true; +} + FillNotificationData::FillNotificationData(Permissions& data, GroupConsent group_state, GroupConsent undefined_group_consent, |