Add [cmd:permissions]

这个提交包含在:
2023-07-28 15:04:58 +02:00
父节点 234db99ef5
当前提交 1095d38b02
修改 7 个文件,包含 94 行新增10 行删除

查看文件

@@ -98,7 +98,10 @@ Response Handler::handle(const Request &r)
Permissions Handler::effectivePermissions(std::string page)
{
return this->database->createPermissionsDao()
->find(page, this->userSession->user.login)
.value_or(this->userSession->user.permissions);
Permissions &userPerms = this->userSession->user.permissions;
if(userPerms.isAdmin())
{
return userPerms;
}
return this->database->createPermissionsDao()->find(page, this->userSession->user.login).value_or(userPerms);
}