public List <Category> GetAllowedCategories(IMemberGroup role, string actionType, PermissionService permissionService, MemberService memberService, CategoryPermissionService categoryPermissionService) { var cacheKey = string.Concat("GetAllowedCategoriesCode-", role.Id, "-", actionType); return((List <Category>)ApplicationContext.Current.ApplicationCache.RequestCache.GetCacheItem(cacheKey, () => { var filteredCats = new List <Category>(); var allCats = GetAll(); foreach (var category in allCats) { var permissionSet = permissionService.GetPermissions(category, role, memberService, categoryPermissionService); if (!permissionSet[actionType].IsTicked) { // TODO Only add it category is NOT locked filteredCats.Add(category); } } return filteredCats; })); }
public List <Category> GetAllowedCategories(IMemberGroup role, PermissionService permissionService, MemberService memberService, CategoryPermissionService categoryPermissionService) { return(GetAllowedCategories(role, AppConstants.PermissionDenyAccess, permissionService, memberService, categoryPermissionService)); }