Skip to content

Commit 2d38b86

Browse files
authored
Don't show public spaces for readonly role (#9182)
Signed-off-by: Anton Alexeyev <[email protected]>
1 parent 95a2ba3 commit 2d38b86

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/middleware/src/spaceSecurity.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,8 @@ export class SpaceSecurityMiddleware extends BaseMiddleware implements Middlewar
466466
...this.systemSpaces,
467467
...this.mainSpaces
468468
]
469-
const unfilteredRes = isData ? res : [...res, ...this.publicSpaces]
469+
const ignorePublicSpaces = isData || account.role === AccountRole.ReadOnlyGuest
470+
const unfilteredRes = ignorePublicSpaces ? res : [...res, ...this.publicSpaces]
470471
if (showArchived) {
471472
return unfilteredRes
472473
}

0 commit comments

Comments
 (0)