mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
feat: admins can change user's roles
refactor: banned role has priority over all other roles when displaying chore: npm run format
This commit is contained in:
@@ -67,6 +67,10 @@ namespace SharpbinV3.Server.Controllers
|
||||
user.Email = updatedUser.Email ?? user.Email;
|
||||
user.Visibility = updatedUser.Visibility ?? user.Visibility;
|
||||
}
|
||||
if (userRoles.Any(r => r == 255))
|
||||
{
|
||||
user.Roles = updatedUser.Roles ?? user.Roles;
|
||||
}
|
||||
await _db.SaveChangesAsync();
|
||||
return Ok(new { message = "User updated successfully." });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user