public void AddRange(TabPermissionCollection tabPermissions)
 {
     foreach (TabPermissionInfo permission in tabPermissions)
     {
         Add(permission);
     }
 }
 public bool CompareTo(TabPermissionCollection objTabPermissionCollection)
 {
     if (objTabPermissionCollection.Count != this.Count)
     {
         return false;
     }
     InnerList.Sort(new CompareTabPermissions());
     objTabPermissionCollection.InnerList.Sort(new CompareTabPermissions());
     for (int i = 0; i <= this.Count - 1; i++)
     {
         if (objTabPermissionCollection[i].TabPermissionID != this[i].TabPermissionID || objTabPermissionCollection[i].AllowAccess != this[i].AllowAccess)
         {
             return false;
         }
     }
     return true;
 }
 public TabPermissionCollection(TabPermissionCollection tabPermissions)
 {
     AddRange(tabPermissions);
 }
예제 #4
0
 public static void CopyPermissionsToChildren(TabInfo parentTab, TabPermissionCollection newPermissions)
 {
     Security.Permissions.TabPermissionController objTabPermissionController = new Security.Permissions.TabPermissionController();
     bool clearCache = Null.NullBoolean;
     List<TabInfo> childTabs = new TabController().GetTabsByPortal(parentTab.PortalID).DescendentsOf(parentTab.TabID);
     foreach (TabInfo objTab in childTabs)
     {
         if (TabPermissionController.CanAdminPage(objTab))
         {
             objTab.TabPermissions.Clear();
             objTab.TabPermissions.AddRange(newPermissions);
             TabPermissionController.SaveTabPermissions(objTab);
             clearCache = true;
         }
     }
     if (clearCache)
     {
         DataCache.ClearTabsCache(childTabs[0].PortalID);
     }
 }
 public TabPermissionCollection(TabPermissionCollection tabPermissions)
 {
     AddRange(tabPermissions);
 }
 public static bool HasTabPermission(TabPermissionCollection objTabPermissions, string permissionKey)
 {
     bool hasPermission = provider.HasTabPermission(objTabPermissions, "EDIT");
     if (!hasPermission)
     {
         if (permissionKey.Contains(","))
         {
             foreach (string permission in permissionKey.Split(','))
             {
                 if (provider.HasTabPermission(objTabPermissions, permission))
                 {
                     hasPermission = true;
                     break;
                 }
             }
         }
         else
         {
             hasPermission = provider.HasTabPermission(objTabPermissions, permissionKey);
         }
     }
     return hasPermission;
 }