Repository navigation
feat: apply page permissions to the Pages tab - #13
Merged
Merged
Conversation
List only the pages the signed-in user can see in Xperience's page tree: Display through the page's access-control list, with administrators and Manage permissions bypassing it, as in Kentico. Pages only on the target follow their nearest ancestor here. Filtering happens before counting, sorting and paging, and reorder tooltips never name a hidden page. Read the page-to-list mapping in one batched query and evaluate each distinct list once through the public API, falling back to the per-page public API; a failure hides pages instead of showing them. Update the admin page spec, Usage Guide and content tree indicators spec.
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.
Applies Kentico's page permissions to the Pages tab, so editors only see the pages they can see in Xperience's own page tree.
Why
Channel and workspace filtering was already in place, but within a channel anyone with Access channel saw the status (path, type, dates) of every page, including sections their roles can't see in the page tree.
Changes
WebPageAclPermissions.DISPLAY,WebsiteChannelUIPermissions.MANAGE_PERMISSIONS).ContentSyncPageVisibility(unit tested):ContentSyncReorder.HiddenMisplacedCount).IContentSyncScopeAccess.GetPageVisibilityAsync. Kentico's publicIWebPageAclManager.GetPermissionscosts about three queries per page and doesn't cache (decompiled, identical in 30.8.0 and 31.7.2), too slow for a large channel. So the page-to-list mapping is read in one batched query by object type name (cms.webpageaclmapping, whose Info class is internal, the same pattern as display names), and the public API is called once per distinct list. If the mapping query fails, the public API is called for every page (slower, never wrong); if permissions can't be read at all, the tab shows the generic error row, so a failure hides pages instead of showing them.ViewSyncStatuspermission.Testing
250 unit tests pass (new: visibility rules, pages only on the target, broken inheritance, unavailable target, and reorder tooltips that count hidden pages); format check clean.
Verified live on 31.7.2 with the Playwright CLI, comparing the Pages tab with Kentico's own page tree for the same restricted user (
sync-status-tester, role Article reviewer with Access channel):The administrator saw 65 throughout. The permission changes were made in Kentico's admin and restored afterwards.