Change-Id: Ib3566b86f491c389285eaffd9e8f863a95e28b90
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
#ifndef __CONTEXT_CLIENT_BASE_H__
#define __CONTEXT_CLIENT_BASE_H__
+#include <vector>
#include <string>
#include <ContextTypes.h>
bool hasPrivilege(const char* privil) const;
+ bool hasPrivileges(const std::vector<std::string>& privil) const;
+
uid_t getUid() const;
std::string getClientId() const;
return __credential->hasPrivilege(privil);
}
+bool ClientBase::hasPrivileges(const std::vector<std::string>& privil) const
+{
+ for (auto& item : privil) {
+ if (!hasPrivilege(item.c_str()))
+ return false;
+ }
+ return true;
+}
+
uid_t ClientBase::getUid() const
{
return __credential->getUid();