diff options
author | Alex Kutsan <akutsan@luxoft.com> | 2018-03-28 23:29:44 +0300 |
---|---|---|
committer | Alex Kutsan <akutsan@luxoft.com> | 2018-03-29 01:12:06 +0300 |
commit | 05c8960c2d8683e4aadecb4a7705b1faf6aca378 (patch) | |
tree | c5f8abd65fccb8b2d6221f3cef791d587de26ce4 /src/components/policy/policy_external | |
parent | b720160a665f3a3e8fb1ae03907a2f16f9ce519a (diff) | |
download | sdl_core-05c8960c2d8683e4aadecb4a7705b1faf6aca378.tar.gz |
Move checking if app revoked in the begining of check Permissions
In case if app revoked it should not be checked for any other
permissions
Diffstat (limited to 'src/components/policy/policy_external')
-rw-r--r-- | src/components/policy/policy_external/src/policy_manager_impl.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index c9c0516d4d..2cd0d2b23b 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -609,6 +609,17 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id, << " returns true"); } + if (cache_->IsApplicationRevoked(app_id)) { + // SDL must be able to notify mobile side with its status after app has + // been revoked by backend + if ("OnHMIStatus" == rpc && "NONE" == hmi_level) { + result.hmi_level_permitted = kRpcAllowed; + } else { + result.hmi_level_permitted = kRpcDisallowed; + } + return; + } + const bool known_rpc = rpc_permissions.end() != rpc_permissions.find(rpc); LOG4CXX_DEBUG(logger_, "Is known rpc " << (known_rpc ? "true" : "false") ); @@ -712,17 +723,6 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id, LOG4CXX_DEBUG(logger_, "There are no parameters allowed."); result.hmi_level_permitted = kRpcDisallowed; } - - if (cache_->IsApplicationRevoked(app_id)) { - // SDL must be able to notify mobile side with its status after app has - // been revoked by backend - if ("OnHMIStatus" == rpc && "NONE" == hmi_level) { - result.hmi_level_permitted = kRpcAllowed; - } else { - result.hmi_level_permitted = kRpcDisallowed; - } - return; - } } bool PolicyManagerImpl::ResetUserConsent() { |