Prevent from collision with system privileges 42/129242/2 appdefined
authorDariusz Michaluk <d.michaluk@samsung.com>
Mon, 15 May 2017 12:50:18 +0000 (14:50 +0200)
committerDariusz Michaluk <d.michaluk@samsung.com>
Wed, 17 May 2017 08:51:50 +0000 (10:51 +0200)
Change-Id: If307f2b4609d5af45126cdd1aac2e577d8ad5cac

src/common/service_impl.cpp

index 36491f3..46a7404 100644 (file)
@@ -96,11 +96,11 @@ private:
 };
 
 bool verifyAppDefinedPrivileges(const AppDefinedPrivilegesVector &privileges) {
-    // TODO check for collision with system privileges
-
     // check if licenses are set for license-privileges
+    // check for collision with system privileges
     for (auto &e : privileges) {
-        if ((std::get<1>(e) == SM_APP_DEFINED_PRIVILEGE_TYPE_LICENSED) && std::get<2>(e).empty())
+        if (((std::get<1>(e) == SM_APP_DEFINED_PRIVILEGE_TYPE_LICENSED) && std::get<2>(e).empty()) ||
+            (std::get<0>(e).find("http://tizen.org/privilege/") != std::string::npos))
             return false;
     }
     return true;