示例#1
0
        private void UpdateEditPermissions()
        {
            var menuItems = PersonaBarRepository.Instance.GetMenu().AllItems;

            foreach (PortalInfo portal in PortalController.Instance.GetPortals())
            {
                var portalId = portal.PortalID;
                if (MenuPermissionController.PermissionAlreadyInitialized(portalId))
                {
                    menuItems.ForEach(i => this.SaveEditPermission(portalId, i));
                }
            }
        }
 private void SaveMenuPermission(MenuItem menuItem, string roleName)
 {
     var portals = PortalController.Instance.GetPortals();
     foreach (PortalInfo portal in portals)
     {
         var portalId = portal.PortalID;
         //when default permission already initialized, then package need to save default permission immediately.
         if (MenuPermissionController.PermissionAlreadyInitialized(portalId))
         {
             MenuPermissionController.SaveMenuDefaultPermissions(portalId, menuItem, roleName);
         }
     }
 }