diff options
Diffstat (limited to 'src/components/policy/src/policy/src/policy_helper.cc')
-rw-r--r-- | src/components/policy/src/policy/src/policy_helper.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/components/policy/src/policy/src/policy_helper.cc b/src/components/policy/src/policy/src/policy_helper.cc index 2677e5789c..5a4682bbcf 100644 --- a/src/components/policy/src/policy/src/policy_helper.cc +++ b/src/components/policy/src/policy/src/policy_helper.cc @@ -76,8 +76,9 @@ bool operator()(const policy::StringsValueType& value) { checker); if (groups_attributes_.end() == it) { return false; - } + } FunctionalGroupPermission group; + group.group_name = it->second.second; group.group_alias = it->second.first; group.group_id = it->first; groups_permissions_.push_back(group); @@ -152,6 +153,17 @@ bool policy::CheckAppPolicy::HasRevokedGroups( it_groups_new, it_groups_new_end, std::back_inserter(revoked_group_list), Compare); + // Remove groups which are not required user consent + policy_table::Strings::iterator it_revoked = revoked_group_list.begin(); + for (;revoked_group_list.end() != it_revoked; ) { + if (!IsConsentRequired(app_policy.first, std::string(*it_revoked))) { + revoked_group_list.erase(it_revoked); + it_revoked = revoked_group_list.begin(); + } else { + ++it_revoked; + } + } + if (revoked_groups) { *revoked_groups = revoked_group_list; } |