Sfoglia il codice sorgente

fixed small bug for superAdmin

BE_dev
Dzenis Hadzifejzovic 2 anni fa
parent
commit
d263b1b039
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1
    1
      Diligent.WebAPI.Business/Services/CategoryService.cs

+ 1
- 1
Diligent.WebAPI.Business/Services/CategoryService.cs Vedi File

@@ -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…
Annulla
Salva