Browse Source

Fixed vault deletion for admins

feature/billing
Teknikode 8 months ago
parent
commit
4b0c3fa4c1
  1. 3
      Teknik/Areas/Vault/Controllers/VaultController.cs

3
Teknik/Areas/Vault/Controllers/VaultController.cs

@ -435,7 +435,8 @@ namespace Teknik.Areas.Vault.Controllers @@ -435,7 +435,8 @@ namespace Teknik.Areas.Vault.Controllers
Vault.Models.Vault foundVault = _dbContext.Vaults.Where(v => v.Url == id).FirstOrDefault();
if (foundVault != null)
{
if (foundVault.User.Username == User.Identity.Name)
if (foundVault.User.Username == User.Identity.Name ||
User.IsInRole("Admin"))
{
_dbContext.Vaults.Remove(foundVault);
_dbContext.SaveChanges();

Loading…
Cancel
Save