new permission

7 个月 前

        public static readonly PermissionRecord ManageHelp = new PermissionRecord { Name = "Admin area. Manage Help Roles", SystemName = "Help", Category = "Help" };


    <siteMapNode SystemName="Help" nopResource="Admin.Help" PermissionNames="ManageHelp" IconClass="fa-question-circle">
      <siteMapNode SystemName="Help topics" nopResource="Admin.Help.Topics" url="https://docs.nopcommerce.com?utm_source=admin-panel&amp;utm_medium=menu&amp;utm_campaign=admin-panel"  IconClass="fa-dot-circle-o" OpenUrlInNewTab="true"/>
      <siteMapNode SystemName="Community forums" nopResource="Admin.Help.Forums" url="https://www.nopcommerce.com/boards?utm_source=admin-panel&amp;utm_medium=menu&amp;utm_campaign=admin-panel"  IconClass="fa-dot-circle-o" OpenUrlInNewTab="true"/>
      <siteMapNode SystemName="Premium support services" nopResource="Admin.Help.SupportServices" url="https://www.nopcommerce.com/nopcommerce-premium-support-services?utm_source=admin-panel&amp;utm_medium=menu&amp;utm_campaign=admin-panel"  IconClass="fa-dot-circle-o" OpenUrlInNewTab="true"/>
    </siteMapNode>


Added to database tables
"PermissionRecord"
"PermissionRecord_Role_Mapping" => admin
The menu hide foe all but the role appear in ACL.


Thanks
7 个月 前
Hello khedr
You have to add ManageHelp name in permission records system name field.
  
     public static readonly PermissionRecord ManageHelp = new PermissionRecord { Name = "Admin area. Manage Help Roles", SystemName = "ManageHelp", Category = "Help" };


Because you given Managerhelp permission name in sitemap.

<siteMapNode SystemName="Help" nopResource="Admin.Help" PermissionNames="ManageHelp" IconClass="fa-question-circle">
      <siteMapNode SystemName="Help topics" nopResource="Admin.Help.Topics" url="https://docs.nopcommerce.com?utm_source=admin-panel&amp;utm_medium=menu&amp;utm_campaign=admin-panel"  IconClass="fa-dot-circle-o" OpenUrlInNewTab="true"/>
      <siteMapNode SystemName="Community forums" nopResource="Admin.Help.Forums" url="https://www.nopcommerce.com/boards?utm_source=admin-panel&amp;utm_medium=menu&amp;utm_campaign=admin-panel"  IconClass="fa-dot-circle-o" OpenUrlInNewTab="true"/>
      <siteMapNode SystemName="Premium support services" nopResource="Admin.Help.SupportServices" url="https://www.nopcommerce.com/nopcommerce-premium-support-services?utm_source=admin-panel&amp;utm_medium=menu&amp;utm_campaign=admin-panel"  IconClass="fa-dot-circle-o" OpenUrlInNewTab="true"/>
    </siteMapNode>
7 个月 前
issue is solved khedr from the above solution?
7 个月 前
Yes. Thank you.
7 个月 前
Is there any code have to write to insert permission into database except for..

        public static readonly PermissionRecord ManageHelp = new PermissionRecord { Name = "Admin area. Manage Help Roles", SystemName = "ManageHelp", Category = "Help" };


Thank you.
7 个月 前
PermissionRecord manageHelp = new PermissionRecord { Name = "Admin area. Manage Help Roles",
    SystemName = "ManageHelp", Category = "Help" };
var record = _permissionService.GetPermissionRecordBySystemName("ManageHelp");
if (record == null)
    _permissionService.InsertPermissionRecord(manageHelp );
7 个月 前
I have many new permissions. What is best practice to add them when application startup ?

Thank you.