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:
2026-01-06 14:07:55 -05:00
parent fe54ff15ce
commit 99feb2795a
8 changed files with 188 additions and 112 deletions
@@ -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." });
}