Skip to content

Code Tidy: Clean up further obsoleted code scheduled for removal in Umbraco 18 (IEmailSender, MemberConfigurationResponseModel, MediaPermissions)#22642

Merged
Zeegaan merged 3 commits into
v18/devfrom
v18/task/further-todos-and-obsoletes-6
Apr 30, 2026
Merged

Code Tidy: Clean up further obsoleted code scheduled for removal in Umbraco 18 (IEmailSender, MemberConfigurationResponseModel, MediaPermissions)#22642
Zeegaan merged 3 commits into
v18/devfrom
v18/task/further-todos-and-obsoletes-6

Conversation

@AndyButland

@AndyButland AndyButland commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Description

This is a further PR that removes obsolete members scheduled for removal in Umbraco 18, covering three independent cleanups bundled together.

1. IEmailSender

  • Removed two obsolete SendAsync overloads:
    • SendAsync(EmailMessage, string)
    • SendAsync(EmailMessage, string, bool)
  • Removed the default interface implementation on the modern overload SendAsync(EmailMessage, string, bool, TimeSpan?), which existed only to bridge the obsolete overloads.
  • Updated the two implementations (EmailSender, NotImplementedEmailSender) to drop the obsolete overloads.
  • No call-site updates needed - all production callers were already using the modern overload.

2. MemberConfigurationResponseModel

  • Removed the obsolete empty MemberConfigurationResponseModel view model.
  • Removed the orphaned ConfigurationMemberController whose only purpose was returning that empty model (corresponding to the GET /umbraco/management/api/v1/member/configuration endpoint).
  • Removed CreateMemberConfigurationResponseModel() from IConfigurationPresentationFactory and its implementation in ConfigurationPresentationFactory.

3. MediaPermissions (in Umbraco.Cms.Core.Security)

  • Removed the obsolete MediaPermissions class along with its Services.AddSingleton<MediaPermissions>() registration.
  • Removed MediaPermissionsTests (7 tests covering the obsolete class).
  • Added new MediaPermissionServiceTests covering the non-obsolete replacement IMediaPermissionService. The new test class mirrors all 7 original scenarios on the equivalent service methods (AuthorizeAccessAsync, AuthorizeRootAccessAsync, AuthorizeBinAccessAsync) and adds 5 further tests covering API surface that wasn't on the old class (multi-key authorize, empty-keys edge case, FilterAuthorizedAccessAsync).

Testing

Build checks should pass - solution should build and test suite should complete without failures.

Copilot AI review requested due to automatic review settings April 29, 2026 10:55
@claude

claude Bot commented Apr 29, 2026

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

@AndyButland AndyButland changed the title Code Tidy: Clean up further obsoleted code scheduled for removal in Umbraco 18 Code Tidy: Clean up further obsoleted code scheduled for removal in Umbraco 18 (IEmailSender, MemberConfigurationResponseModel, MediaPermissions) Apr 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Removes additional obsolete APIs/types scheduled for removal in Umbraco 18, including email sender overloads, an unused member-configuration management endpoint/model, and the legacy MediaPermissions class in favor of IMediaPermissionService.

Changes:

  • Removed obsolete IEmailSender.SendAsync overloads and updated implementations accordingly.
  • Removed the unused Management API member configuration endpoint/model and its presentation factory method.
  • Removed obsolete MediaPermissions + DI registration, and replaced legacy tests with MediaPermissionServiceTests for IMediaPermissionService.

Reviewed changes

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

Show a summary per file
File Description
tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/MediaPermissionServiceTests.cs Adds unit coverage for IMediaPermissionService scenarios (including multi-key + filtering).
tests/Umbraco.Tests.UnitTests/Umbraco.Core/Security/MediaPermissionsTests.cs Removes tests for the obsolete MediaPermissions class.
src/Umbraco.Infrastructure/Mail/EmailSender.cs Drops obsolete SendAsync overload implementations.
src/Umbraco.Core/Security/MediaPermissions.cs Removes the obsolete MediaPermissions class.
src/Umbraco.Core/Mail/NotImplementedEmailSender.cs Drops obsolete SendAsync overloads, keeping the modern signature.
src/Umbraco.Core/Mail/IEmailSender.cs Removes obsolete overloads and default interface bridging implementation.
src/Umbraco.Core/DependencyInjection/UmbracoBuilder.cs Removes DI registration of the obsolete MediaPermissions.
src/Umbraco.Cms.Api.Management/ViewModels/Member/MemberConfigurationResponseModel.cs Removes the obsolete/empty response model.
src/Umbraco.Cms.Api.Management/Factories/IConfigurationPresentationFactory.cs Removes the member configuration presentation factory method.
src/Umbraco.Cms.Api.Management/Factories/ConfigurationPresentationFactory.cs Removes the factory implementation for the member configuration model.
src/Umbraco.Cms.Api.Management/Controllers/Member/ConfigurationMemberController.cs Removes the orphaned member configuration controller/endpoint.
Comments suppressed due to low confidence (1)

src/Umbraco.Cms.Api.Management/Factories/ConfigurationPresentationFactory.cs:83

  • After removing the member configuration response model/controller, the generated backoffice client code still exposes this operation/model (e.g. src/Umbraco.Web.UI.Client/src/packages/core/backend-api/sdk.gen.ts#getMemberConfiguration and types.gen.ts still contain MemberConfigurationResponseModel). Please regenerate/update the OpenAPI-driven client artifacts (or remove the stale operation/model) so the repo doesn’t keep shipping a client that targets a now-removed endpoint (/umbraco/management/api/v1/member/configuration).
    /// <summary>
    /// Creates a <see cref="Umbraco.Cms.Api.Management.Models.MemberTypeConfigurationResponseModel"/> containing the reserved member field names.
    /// </summary>
    /// <returns>A <see cref="Umbraco.Cms.Api.Management.Models.MemberTypeConfigurationResponseModel"/> with reserved member field names populated.</returns>
    public MemberTypeConfigurationResponseModel CreateMemberTypeConfigurationResponseModel() =>
        new()
        {
            ReservedFieldNames = _reservedFieldNamesService.GetMemberReservedFieldNames(),
        };

@Zeegaan Zeegaan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great 💪

@Zeegaan Zeegaan merged commit 6a75489 into v18/dev Apr 30, 2026
31 of 33 checks passed
@Zeegaan Zeegaan deleted the v18/task/further-todos-and-obsoletes-6 branch April 30, 2026 00:56
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.

3 participants