Hide admin menu for vendor

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Hi All,

I need to hide Catalog, Sales, Help menu for vendor, I want the vendor have access only to his dashboard, how can I do this please?

Thank you
6 years ago
Hi

You can go to admin side and configure role wise access to vendor.

http://admin-demo.nopcommerce.com/Admin/Security/Permissions
6 years ago
Bivolini wrote:
Hi All,

I need to hide Catalog, Sales, Help menu for vendor, I want the vendor have access only to his dashboard, how can I do this please?

Thank you
.

Hello, Current nop commerce haven't feature of hide whole catalog and sales.

If you need than you have to add permission in ACL from db.

I think you have to slightly customize for that in ACL related files.
6 years ago
Thank you, this solve the problem
6 years ago
You can put a check at MenuItem.cshtml of Presentation==>Nop.Web==>Areas==>Admin==>Views==>Shared.

@using Nop.Core.Plugins
@using Nop.Services.Security
@using Nop.Web.Framework.Menu
@using Nop.Core.Infrastructure;
@using Nop.Core;
@using Nop.Core.Domain.Customers;
@inject IPluginFinder pluginFinder
@inject IPermissionService permissionService

@{
    //load sitemap
    var siteMap = new XmlSiteMap();
    siteMap.LoadFrom("~/Areas/Admin/sitemap.config");

   var _workContext = EngineContext.Current.Resolve<IWorkContext>();
    var IsUserVendor = _workContext.CurrentCustomer.IsVendor();
}

  @foreach (var item in rootNode.ChildNodes.Where(x => x.Visible))
    {
        if (IsUserVendor && (item.SystemName != "Help" && item.SystemName != "Catalog" && item.SystemName != "Sales"))
        {
        @await Html.PartialAsync("_MenuItem", item)
        }
        else
        {
            if (!IsUserVendor)
            {
             @await Html.PartialAsync("_MenuItem", item)
            }

        }

    @*@await Html.PartialAsync("_MenuItem", item)*@
    }


Important: It will not render these menus and you will also lose the power of nopcommerce ACL for managing the menu item for the vendor roled user. For other users, it should work.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.