Skip to content

Commit

Permalink
Replace AdminRouteAttribute with AdminAttribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahelsaig committed Mar 18, 2024
1 parent cbc63b1 commit c068c37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Lombiq.JsonEditor/Controllers/AdminController.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using AngleSharp.Common;
using Lombiq.HelpfulLibraries.OrchardCore.Contents;
using Lombiq.HelpfulLibraries.OrchardCore.DependencyInjection;
using Lombiq.HelpfulLibraries.OrchardCore.Mvc;
using Lombiq.JsonEditor.ViewModels;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Localization;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.Extensions.Localization;
using OrchardCore.Admin;
using OrchardCore.ContentManagement;
using OrchardCore.ContentManagement.Metadata;
using OrchardCore.Contents;
Expand Down Expand Up @@ -58,7 +58,7 @@ public AdminController(
H = services.HtmlLocalizer.Value;
}

[AdminRoute("Contents/ContentItems/{contentItemId}/Edit/Json")]
[Admin("Contents/ContentItems/{contentItemId}/Edit/Json")]
public async Task<IActionResult> Edit(string contentItemId)
{
if (string.IsNullOrWhiteSpace(contentItemId) ||
Expand Down
2 changes: 0 additions & 2 deletions Lombiq.JsonEditor/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Lombiq.HelpfulLibraries.OrchardCore.DependencyInjection;
using Lombiq.HelpfulLibraries.OrchardCore.Mvc;
using Lombiq.JsonEditor.Constants;
using Lombiq.JsonEditor.Drivers;
using Lombiq.JsonEditor.Fields;
Expand Down Expand Up @@ -43,6 +42,5 @@ public override void ConfigureServices(IServiceCollection services)
services.AddOrchardServices();
services.AddScoped<ApiController>();
services.AddContentSecurityPolicyProvider<JsonEditorContentSecurityPolicyProvider>();
AdminRouteAttributeRouteMapper.AddToServices(services);
}
}

0 comments on commit c068c37

Please sign in to comment.