Take the community feedback survey now.

Pawan Singh
Jul 20, 2025
  245
(1 votes)

Disable Report and Dashboard Menu content editors

We had a requirement where Report and Dashboard menus were needed only for specific roles/users Or Admins — but not for editors.

Below is default view for editors where  you can see these menus:

But required view is: 



1.  To achieve above, we implemented a  custom Interceptor class that wraps another IMenuProvider and overrides the authorization logic as below.

using EPiServer.Shell.Navigation;
namespace alloy_example.Customization.Menus;

public class MenuProviderInterceptor : IMenuProvider
{
    private readonly IMenuProvider _menu;

    public MenuProviderInterceptor(IMenuProvider menu)
    {
        _menu = menu;
    }

    public IEnumerable<MenuItem> GetMenuItems()
    {
        var menuItems = _menu.GetMenuItems().ToList();
        menuItems.ForEach(item =>
        {           
            item.AuthorizationPolicy = "episerver:cmsadmin";
        });
        return menuItems;
    }
}


 2. we need to hook this interceptor only for specific providers — like ReportsMenuProvider or DashboardMenuProvider based on requirement.

services.Intercept<IMenuProvider>(interceptorFactory);

private static IMenuProvider interceptorFactory(IServiceProvider provider1, IMenuProvider provider2)
 {
     var types = new[] { typeof(ReportsMenuProvider), typeof(DashboardMenuProvider) };
     return types.Any(t => t.Equals(provider2.GetType())) ? new MenuProviderInterceptor(provider2) : provider2;
 }

This way, only ReportsMenuProvider and DashboardMenuProvider are affected — all other menus remain untouched. Hope this helps someone!

Jul 20, 2025

Comments

Please login to comment.
Latest blogs
Optimizely CMS Mixed Auth - Okta + ASP.NET Identity

Configuring mixed authentication and authorization in Optimizely CMS using Okta and ASP.NET Identity.

Damian Smutek | Oct 27, 2025 |

Optimizely: Multi-Step Form Creation Through Submission

I have been exploring Optimizely Forms recently and created a multi-step Customer Support Request Form with File Upload Functionality.  Let’s get...

Madhu | Oct 25, 2025 |

How to Add Multiple Authentication Providers to an Optimizely CMS 12 Site (Entra ID, Google, Facebook, and Local Identity)

Modern websites often need to let users sign in with their corporate account (Entra ID), their social identity (Google, Facebook), or a simple...

Francisco Quintanilla | Oct 22, 2025 |

Connecting the Dots Between Research and Specification to Implementation using NotebookLM

Overview As part of my day to day role as a solution architect I overlap with many clients, partners, solutions and technologies. I am often...

Scott Reed | Oct 22, 2025