Skip to content

Allow segment access to editors with access to documents, not only settings #19291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: release/16.0
Choose a base branch
from

Conversation

AndyButland
Copy link
Contributor

Prerequisites

  • I have added steps to test this contribution in the description below

Description

Noticed in a testing that with a user that didn't have access to "Settings" and with segments setup, you'd get a permissions error. This resolves it by asking only for "Document" section permissions.

Testing

Unless you already have segments set up for another reason, likely sufficient to visually inspect this one.

Release

No harm if this goes into 16.0-rc2, since it's a fix to an 16 specific issue.

@Copilot Copilot AI review requested due to automatic review settings May 9, 2025 15:20
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a permission error by allowing segment access for editors with "Document" permissions rather than exclusively "Settings" access. Key changes include adding an authorization policy for document access and removing the outdated settings access policy.

  • Updated SegmentControllerBase to use TreeAccessDocuments policy.
  • Removed settings-based authorization from AllSegmentController.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Umbraco.Cms.Api.Management/Controllers/Segment/SegmentControllerBase.cs Added [Authorize(Policy = AuthorizationPolicies.TreeAccessDocuments)] to enforce document permissions.
src/Umbraco.Cms.Api.Management/Controllers/Segment/AllSegmentController.cs Removed obsolete [Authorize(Policy = AuthorizationPolicies.SectionAccessSettings)] attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant