Build system changed to Cmake, ORM changed to QxORM, Qt6 compatibility.
This commit is contained in:
@@ -10,12 +10,12 @@ PermissionEvaluator::PermissionEvaluator(QObject *parent)
|
||||
{
|
||||
}
|
||||
|
||||
PermissionEvaluator::~PermissionEvaluator()
|
||||
{
|
||||
}
|
||||
|
||||
bool PermissionEvaluator::hasPermission(const QString &pluginId, const QString &permission)
|
||||
{
|
||||
if (!Context::instance().currentUser()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Context::instance().currentUser()->isAdmin())
|
||||
{
|
||||
return true;
|
||||
@@ -24,7 +24,7 @@ bool PermissionEvaluator::hasPermission(const QString &pluginId, const QString &
|
||||
bool ret;
|
||||
QList<QSharedPointer<Role> > roles = Context::instance().currentUser()->listRoles();
|
||||
|
||||
ret = std::find_if(ALL(roles), [&pluginId, &permission](QSharedPointer<Role> role) -> bool {
|
||||
ret = std::find_if(ALL(roles), [&pluginId, &permission](const QSharedPointer<Role>& role) -> bool {
|
||||
foreach (QSharedPointer<Permission> perm, role->listPermissions()) {
|
||||
if (perm->pluginId() == pluginId && perm->permissionName() == permission) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user