Bläddra i källkod

fixed small bug for superAdmin

BE_dev
Dzenis Hadzifejzovic 2 år sedan
förälder
incheckning
d263b1b039
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1
    1
      Diligent.WebAPI.Business/Services/CategoryService.cs

+ 1
- 1
Diligent.WebAPI.Business/Services/CategoryService.cs Visa fil

@@ -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;

Laddar…
Avbryt
Spara