Removing "Help" sub-menu

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

How is it possible to remove "Help" sub-menu from the Admin menu?

P.S. not by removing it from sitemap.config, but removing it just for certain customer roles.

Thanks a lot!
10 years ago
kiriz wrote:
Hi!

How is it possible to remove "Help" sub-menu from the Admin menu?

P.S. not by removing it from sitemap.config, but removing it just for certain customer roles.

Thanks a lot!


Hello kiriz,

By default, the only way to remove the sub-menu or menu items from the admin section is to comment out / remove the link from sitemap.config.

If you go to "Configuration > Access control list": you will see the permissions that you can give to other users based on roles but currently there is no role-based access for help menu. That's something that you will have to add it manually by doing a little bit of customization in the code by making is visible based on roles of logged in user help menu / sub - menu items are just the links not a page that requires permission.
10 years ago
L.K wrote:


If you go to "Configuration > Access control list": you will see the permissions that you can give to other users based on roles but currently there is no role-based access for help menu. That's something that you will have to add it manually by doing a little bit of customization in the code by making is visible based on roles of logged in user help menu / sub - menu items are just the links not a page that requires permission.


Could you help me with adding code manually as I am struggling to do it at the moment?

Thanks a lot.
10 years ago
Sure, please give me a few minutes and I will get back to you with the steps.
10 years ago
Ok, the best way (or cleanest way) to accomplish this is by adding Permission name so that you can manage this feature in your admin side also and you don't have to reply on change code every now and then.

In this example, I am going to assume that  you want to hide the whole "Help" menu (you can do  this for a specific sub-menu too):

1) In your sitemap, if you you observe other menus, you will see a a property "Permission Name" and if you compare other menus with Help menu, you will not see that property. Add this property in your help menu like  this:


<siteMapNode title="Help" PermissionNames="ManageHelp" nopResource="Admin.Help" ImageUrl="~/Administration/Content/images/ico-help.png">


2) Now to to your nopCommerce database table and look for the table "Permission Record"

Add  this as a new line / record:

Name: Admin area. Manage Help
SystemName: ManageHelp
Category: Configuration


3) Now restart your complete project again and login as admin. You will notice  that you will not see "Help" menu. The reason is because you have added a new property and by default you are not allowed to see it. Go to Access Control List and you should see a new property "Manage Help": check that  for your role "Administrator" and once you save it you will see the Help menu

That's all

Same way you can give control to other users based on roles from access control list.

P.S. Like I mentioned above, I gave example for whole HELP menu, you can add property to sub menus and manage sub menus accordingly.

Let me know if you have any questions.
10 years ago
Thanks a lot, that solved it!
10 years ago
You're welcome !!!
10 years ago
Please refer to this tutorial for a complete solution: http://www.strivingprogrammers.com/Blog/post/Lavish-Kumar/23/Steps-to-hide-admin-menu-items-in-nopCommerce-3-2-based-on-roles/
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.