-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More backend admin panel functionality #148
Conversation
|
||
var account = await accountService.GetAccountAsync(EpicID.FromString(id)); | ||
if (account is null) | ||
return NotFound(new ErrorResponse() { ErrorMessage = $"Failed to find account {id}" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Braces.
return NotFound(new ErrorResponse() { ErrorMessage = $"Failed to find account {id}" }); | ||
|
||
if (account.Flags.HasFlag(AccountFlags.Moderator) || account.Flags.HasFlag(AccountFlags.Admin)) | ||
throw new UnauthorizedAccessException("Cannot change password of other admins or moderators"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Braces.
} | ||
|
||
[HttpDelete("account/{id}")] | ||
public async Task<IActionResult> DeleteAccountInfo(string id, [FromBody] bool? forceCheckBroken) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same security consideration as in ChangePassword.
} | ||
else | ||
{ | ||
if (admin.Account.Flags.HasFlag(AccountFlags.Admin) && account.Flags.HasFlag(AccountFlags.Admin)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Braces.
|
||
if (admin.Account.Flags.HasFlag(AccountFlags.Moderator) && | ||
(account.Flags.HasFlag(AccountFlags.Admin) || account.Flags.HasFlag(AccountFlags.Moderator))) | ||
throw new UnauthorizedAccessException("Cannot delete account of other admin or moderator"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Braces.
"nigger", "hitler", "nazi" | ||
}; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove one empty line.
@@ -23,15 +23,29 @@ public CloudStorageService(DatabaseContext dbContext) | |||
cloudStorageCollection = dbContext.Database.GetCollection<CloudFile>("cloudstorage"); | |||
} | |||
|
|||
public async Task UpdateSystemfiles() | |||
public async Task EnsureSystemfilesExistAsync() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SystemFiles
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i remember from ut's source that epic calls files in cloud storage Userfiles and Systemfiles with lowercase letters for file. that is why i had across whole codebase originally these with lowercase. i guess i can make them upper... Should also change all other instances of this too. as well as our code filenames.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it doesn't brake functionality of the game client, then it is better to change it everywhere because it was clearly non-conventional naming.
Related: #135 |
Fix runtime exception introduced by #148
ValidationHelper