Fix model find space security (#6210)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2024-08-01 14:30:55 +07:00
committed by GitHub
parent e1e6d6427e
commit f4b6db67a5
+2 -1
View File
@@ -17,6 +17,7 @@ import core, {
AccountRole,
AttachedDoc,
Class,
DOMAIN_MODEL,
Doc,
DocumentQuery,
Domain,
@@ -510,7 +511,7 @@ export class SpaceSecurityMiddleware extends BaseMiddleware implements Middlewar
const isSpace = this.storage.hierarchy.isDerived(_class, core.class.Space)
const field = this.getKey(domain)
if (!isSystem(account) && account.role !== AccountRole.DocGuest) {
if (!isSystem(account) && account.role !== AccountRole.DocGuest && domain !== DOMAIN_MODEL) {
if (!isOwner(account, ctx) || !isSpace) {
if (query[field] !== undefined) {
const res = await this.mergeQuery(account, query[field], domain, isSpace)