mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-25 01:39:53 +00:00
Fix model find space security (#6210)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
e1e6d6427e
commit
f4b6db67a5
@ -17,6 +17,7 @@ import core, {
|
|||||||
AccountRole,
|
AccountRole,
|
||||||
AttachedDoc,
|
AttachedDoc,
|
||||||
Class,
|
Class,
|
||||||
|
DOMAIN_MODEL,
|
||||||
Doc,
|
Doc,
|
||||||
DocumentQuery,
|
DocumentQuery,
|
||||||
Domain,
|
Domain,
|
||||||
@ -510,7 +511,7 @@ export class SpaceSecurityMiddleware extends BaseMiddleware implements Middlewar
|
|||||||
const isSpace = this.storage.hierarchy.isDerived(_class, core.class.Space)
|
const isSpace = this.storage.hierarchy.isDerived(_class, core.class.Space)
|
||||||
const field = this.getKey(domain)
|
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 (!isOwner(account, ctx) || !isSpace) {
|
||||||
if (query[field] !== undefined) {
|
if (query[field] !== undefined) {
|
||||||
const res = await this.mergeQuery(account, query[field], domain, isSpace)
|
const res = await this.mergeQuery(account, query[field], domain, isSpace)
|
||||||
|
Loading…
Reference in New Issue
Block a user