Raids and RaidTemplates are now only editable by their owner or moderators

reworked user rights
This commit is contained in:
t.ruspekhofer 2022-03-21 01:12:35 +01:00
parent cb683723b7
commit 2bf630f3a1
25 changed files with 258 additions and 270 deletions

View file

@ -34,22 +34,12 @@ namespace Lieb.Data
{
user.GuildWars2Accounts.Add(account);
}
await context.SaveChangesAsync();
}
else
{
GuildWars2Account? accountToChange = context.GuildWars2Accounts
.Include(a => a.EquippedBuilds)
.FirstOrDefault(a => a.GuildWars2AccountId == account.GuildWars2AccountId);
if (accountToChange != null)
{
accountToChange.AccountName = account.AccountName;
accountToChange.ApiKey = account.ApiKey;
await context.SaveChangesAsync();
}
context.Update(account);
}
await context.SaveChangesAsync();
}
}