Skip to content

Commit

Permalink
Hide Content edit delete button at frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
AgostiniAlessandro committed Nov 11, 2022
1 parent cff5db9 commit 6308517
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Orchard.Web/Core/Contents/Drivers/ContentsDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Orchard.ContentManagement;
using Orchard.ContentManagement.Drivers;
using Orchard.Core.Contents.Settings;
using Orchard.UI.Admin;

namespace Orchard.Core.Contents.Drivers {
public class ContentsDriver : ContentPartDriver<ContentPart> {
Expand All @@ -27,7 +28,9 @@ protected override DriverResult Editor(ContentPart part, dynamic shapeHelper) {
}

if (part.Id > 0) {
results.Add(ContentShape("Content_DeleteButton", deleteButton => deleteButton));
if (AdminFilter.IsApplied(System.Web.HttpContext.Current.Request.RequestContext)) {
results.Add(ContentShape("Content_DeleteButton", deleteButton => deleteButton));
}
}

return Combined(results.ToArray());
Expand Down

0 comments on commit 6308517

Please sign in to comment.