#include "permissionservice.h" PermissionService::PermissionService() { } PermissionService::~PermissionService() { } QList > PermissionService::forPlugin(const QString &pluginId) { Transaction tr; odb::database *db = Context::instance().db(); permQuery q(permQuery::pluginId == pluginId); permResult result = db->query(q); QList > ret; for (permResult::iterator it = result.begin(); it != result.end(); it++) { ret.append(it.load()); } tr.commit(); return ret; } QSharedPointer PermissionService::forNameAndPlugin(const QString &name, const QString &pluginId) { Transaction tr; odb::database *db = Context::instance().db(); permQuery q(permQuery::pluginId == pluginId && permQuery::permissionName == name); QSharedPointer p = db->query_one(q); tr.commit(); return p; }