ソースを参照

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)
{

読み込み中…
キャンセル
保存