mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-09 09:20:54 +00:00
Preference fix (#3104)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
e8b347ddc2
commit
71705674f3
@ -79,7 +79,7 @@ export class PrivateMiddleware extends BaseMiddleware implements Middleware {
|
|||||||
if (account._id !== core.account.System) {
|
if (account._id !== core.account.System) {
|
||||||
newQuery = {
|
newQuery = {
|
||||||
...query,
|
...query,
|
||||||
modifiedBy: account._id
|
createdBy: account._id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -97,7 +97,7 @@ export class PrivateMiddleware extends BaseMiddleware implements Middleware {
|
|||||||
(p) =>
|
(p) =>
|
||||||
!hierarchy.isDerived(p._class, core.class.TxCUD) ||
|
!hierarchy.isDerived(p._class, core.class.TxCUD) ||
|
||||||
!targetClasses.has((p as TxCUD<Doc>).objectClass) ||
|
!targetClasses.has((p as TxCUD<Doc>).objectClass) ||
|
||||||
p.modifiedBy === account._id
|
p.createdBy === account._id
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -115,7 +115,7 @@ export class PrivateMiddleware extends BaseMiddleware implements Middleware {
|
|||||||
const domain = this.storage.hierarchy.getDomain(doc._class)
|
const domain = this.storage.hierarchy.getDomain(doc._class)
|
||||||
if (!this.targetDomains.includes(domain)) return true
|
if (!this.targetDomains.includes(domain)) return true
|
||||||
const account = (await getUser(this.storage, ctx))._id
|
const account = (await getUser(this.storage, ctx))._id
|
||||||
return doc.modifiedBy === account || account === core.account.System
|
return doc.createdBy === account || account === core.account.System
|
||||||
}
|
}
|
||||||
|
|
||||||
async filterLookup<T extends Doc>(ctx: SessionContext, lookup: LookupData<T>): Promise<void> {
|
async filterLookup<T extends Doc>(ctx: SessionContext, lookup: LookupData<T>): Promise<void> {
|
||||||
|
Loading…
Reference in New Issue
Block a user