Add default privilege checker 62/109762/2
authorSungbae Yoo <sungbae.yoo@samsung.com>
Wed, 11 Jan 2017 09:38:21 +0000 (18:38 +0900)
committerSungbae Yoo <sungbae.yoo@samsung.com>
Thu, 12 Jan 2017 06:15:08 +0000 (15:15 +0900)
Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
Change-Id: Iad61cc4c41fde54e0ba7e7a04014fb609980c970

src/rmi/service.cpp

index 65dcd63539bd30d8f19628705c4f7b6c30ce1b65..8fc2fb9fb10d6930f633c64141b5b72a1b376374 100644 (file)
@@ -33,6 +33,10 @@ Service::Service(const std::string& path) :
 {
        setNewConnectionCallback(nullptr);
        setCloseConnectionCallback(nullptr);
+
+       onMethodCall = [](const Credentials& cred, const std::string& privilege) {
+               return true;
+       };
 }
 
 Service::~Service()
@@ -68,10 +72,6 @@ Service::ConnectionRegistry::iterator Service::getConnectionIterator(const int i
 
 void Service::setPrivilegeChecker(const PrivilegeChecker& checker)
 {
-       auto check = [checker, this](const Credentials& cred, const std::string& privilege) {
-               return checker(cred, privilege);
-       };
-
        onMethodCall = std::move(checker);
 }