Restrict guest visibility to accessible spaces - #65
Draft
ArtyomSavchenko wants to merge 13 commits into
Draft
Conversation
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
ArtyomSavchenko
marked this pull request as ready for review
August 1, 2026 03:43
ArtyomSavchenko
marked this pull request as draft
August 13, 2026 05:24
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a consistent security layer for restricted workspace roles:
ReadOnlyGuestDocGuestGuestAccountRole.UserIt closes data-discovery gaps in shared/system spaces and aligns read, full-text search, and write handling around declarative row-visibility policies.
Problem
Restricted accounts could access or discover records outside their intended scope:
Person/Employeerecords live in the sharedcontact.space.Contactssystem space.core.space.Workspacewere not protected by ordinary space membership:Collaboratorlove.class.MeetingMinuteslove.class.RoomInfohr.class.Requestnotification.class.PushSubscriptionguest.class.PublicLinkfindAllor full-text search.Security model
Restricted-role threshold
roleOrderis now the single source of truth for identifying a restricted account:This avoids duplicating explicit lists of guest roles across authorization code.
Layer 1 — class/action access
Write operations use the existing permission-group configuration and
TxAccessLevelmetadata:ModulePermissionGroup/ClassPermissionconfiguration is cached;TxApplyIf;TxMixinis checked as an update operation instead of being unconditionally allowed;createdByvalue no longer bypasses class-level access checks.Layer 2 — row visibility
core.mixin.RowVisibilitydeclares how a restricted role may access records in shared or system spaces:ownerFieldlinkedViaRecordspaceMemberdenyAllpublicReadablePolicies are registered with the affected class model and inherited through the hierarchy.
allowKnownIdBypassremains explicit per class. It is disabled for full-text search and mutation checks, where a caller-supplied identifier must not be treated as proof of authorization.Read protection
findAllRowVisibilitypolicy are narrowed to permitted records.searchFulltextRowVisibilitywithout a known-id bypass.Declared policies
core.class.Collaboratorcollaboratoraccountlove.class.MeetingMinuteslove.class.RoomInfohr.class.RequestattachedTopersonnotification.class.PushSubscriptionuseraccountguest.class.PublicLinklinkId; no known-id bypassGuest membership behavior
New named guests no longer inherit the anonymous read-only account’s space membership. Access is granted only through explicit invitation or
autoJoinForRoles.Tests
Added and updated regression coverage for: