added support for External users

fixed potential errors
This commit is contained in:
Sarah Faey 2022-11-13 21:48:56 +01:00
parent a47bc3207d
commit 62dc3d1efa
10 changed files with 257 additions and 130 deletions

View file

@ -234,8 +234,8 @@
{
_raid = RaidService.GetRaid(parsedId);
if (_raid != null && (_raid.RaidOwnerId == _user.Id
|| _user.RoleAssignments.Max(a => a.LiebRole.Level) >= Constants.RaidEditPowerLevel))
if (_raid.RaidOwnerId == _user.Id
|| _user.RoleAssignments.Max(a => a.LiebRole.Level) >= Constants.RaidEditPowerLevel)
{
_startTime = await TimeZoneService.GetLocalDateTime(_raid.StartTimeUTC);
_endTime = await TimeZoneService.GetLocalDateTime(_raid.EndTimeUTC);
@ -301,13 +301,7 @@
{
if(!_raid.Roles.Where(r => r.IsRandomSignUpRole).Any())
{
_raid.Roles.Add(new RaidRole()
{
Spots = 10,
Name = "Random",
Description = _raid.RaidType.ToString(),
IsRandomSignUpRole = true
});
_raid.Roles.Add(RaidService.CreateRandomSignUpRole(_raid.RaidType));
}
foreach(RaidRole role in _raid.Roles.Where(r => !r.IsRandomSignUpRole))