From: Zofia Abramowska Date: Thu, 20 Jul 2017 14:30:15 +0000 (+0200) Subject: Show popup only for "Ask user" policy X-Git-Tag: submit/tizen/20170727.154157~1^2~4^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=159ed6cb73a93c2e515bd2a0222a3c2e6e5f5d65;p=platform%2Fcore%2Fsecurity%2Faskuser.git Show popup only for "Ask user" policy Change-Id: Id0e2b9fb13f8b06ad39668e623d35034ee89c52e --- diff --git a/src/notification-daemon/Logic.cpp b/src/notification-daemon/Logic.cpp index f22dc10..9e6d1c0 100644 --- a/src/notification-daemon/Logic.cpp +++ b/src/notification-daemon/Logic.cpp @@ -154,19 +154,28 @@ void Logic::popup(Protocol::ConnectionFd fd, Protocol::RequestId id, const std:: } if (policies.size() > 1) { - ALOGE("Something strange happened, more than one policy for (" << it->second.appId << ", " << it->second.user << ", " << privilege << ") exists"); + ALOGE("Something strange happened, more than one policy for (" << it->second.appId << ", " + << it->second.user << ", " << privilege << ") exists"); m_serverChannel->popupResponse(fd, id, ASKUSER_DENY_ONCE); return; } - if (policies.front().getLevel() == "Allow") { + std::string policyLevel = policies.front().getLevel(); + + if (policyLevel == "Allow") { m_serverChannel->popupResponse(fd, id, ASKUSER_ALLOW_FOREVER); return; } - if (policies.front().getLevel() == "Deny") { + if (policyLevel == "Deny") { m_serverChannel->popupResponse(fd, id, ASKUSER_DENY_FOREVER); return; } + if (policyLevel != "Ask user") { + ALOGE("Unknown policy set : " << policyLevel << " for (" << it->second.appId << ", " << it->second.user + << ", " << privilege << ")" ); + m_serverChannel->popupResponse(fd, id, ASKUSER_DENY_ONCE); + return; + } auto &pkgId = it->second.pkgLabel; addEvent({fd, id}, new EventPopupCheck(&m_popupper, pkgId, privilege));