소스 검색

Check for private route

BE_dev
bronjaermin 2 년 전
부모
커밋
ead1c97390
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6
    0
      Diligent.WebAPI.Business/Services/CategoryService.cs

+ 6
- 0
Diligent.WebAPI.Business/Services/CategoryService.cs 파일 보기

@@ -31,6 +31,12 @@ namespace Diligent.WebAPI.Business.Services
var user = await _userManager.FindByIdAsync(userId.ToString());
var role = (await _userManager.GetRolesAsync(user))[0];

if(parentCategoryId != -1)
{
var categories = await _context.UserCategories.Where(x => x.UserId == userId && x.CategoryId == parentCategoryId).ToListAsync();
if (categories.Count == 0) return null;
}

if (role == "SuperAdmin")
if (parentCategoryId == -1)
{

Loading…
취소
저장