Esempio n. 1
0
 private void GetChildRights(int parentId, List <SysPermission> list)
 {
     foreach (SysPermission allRight in AllPermissions.Where(p => p.ParentId == parentId))
     {
         list.Add(allRight);
         GetChildRights(allRight.PermissionId, list);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Get permission from the list by its permission name.
 /// </summary>
 /// <param name="permissionName"></param>
 /// <returns></returns>
 public static ApplicationPermission GetPermissionByName(string permissionName)
 {
     return(AllPermissions.Where(p => p.Name == permissionName).FirstOrDefault());
 }