瀏覽代碼

fixed small bug for superAdmin

BE_dev
Dzenis Hadzifejzovic 2 年之前
父節點
當前提交
d263b1b039
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      Diligent.WebAPI.Business/Services/CategoryService.cs

+ 1
- 1
Diligent.WebAPI.Business/Services/CategoryService.cs 查看文件

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

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

Loading…
取消
儲存