mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-15 21:03:30 +00:00
UBER-852: Owner should only see a list of spaces (#3677)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
f281fa1149
commit
1246b5a924
@ -376,7 +376,8 @@ export class SpaceSecurityMiddleware extends BaseMiddleware implements Middlewar
|
||||
const newQuery = query
|
||||
const account = await getUser(this.storage, ctx)
|
||||
const field = this.getKey(_class)
|
||||
if (!isOwner(account)) {
|
||||
|
||||
if (!isOwner(account) || !this.storage.hierarchy.isDerived(_class, core.class.Space)) {
|
||||
if (query[field] !== undefined) {
|
||||
;(newQuery as any)[field] = await this.mergeQuery(account, query[field])
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user