Make site map visible only for administrator role

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 anni tempo fa
Hi guys, I have a list of plugins, and I want to add them to a site map note in the admin dashboard, however, i only want to customer with administrator role can see it. How can i do that? I am using version 3.90, and i don't see the Authenticate method in the IAdminMenuPlugin like the tutorial on pluralsight. Please help me.

public void ManageSiteMap(SiteMapNode rootNode)
        {
            SiteMapNode parentNode = new SiteMapNode()
            {
                Visible = true,
                Title = "Services Management",
                IconClass = "fa-genderless",
                RouteValues = new RouteValueDictionary() {
                    {"area","Admin" }
                }
            };
            parentNode.ChildNodes.Add(new SiteMapNode()
            {
                Visible = true,
                Title = "Configuration Services",
                IconClass = "fa-genderless",
                Url = "Services/Configure",
                RouteValues = new RouteValueDictionary() {
                    {"area","Admin" }
                }
            });
parentNode.ChildNodes.Add(new SiteMapNode()
            {
                Visible = true,
                Title = "Configuration Shipping",
                IconClass = "fa-genderless",
                Url = "Shipping/Configure",
                RouteValues = new RouteValueDictionary() {
                    {"area","Admin" }
                }
            });
            rootNode.ChildNodes.Add(parentNode);
        }
6 anni tempo fa
Use _workContext.CurrentCustomer.IsAdmin() :)
6 anni tempo fa
wooncherk wrote:
Use _workContext.CurrentCustomer.IsAdmin() :)

Where should i put this line into  my code?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.