Skip to content

Let moderators edit another member's planet identity - #1660

Merged
SpikeViper merged 4 commits into
version/0.8.0from
fix/mod-edit-identity
Sep 7, 2026
Merged

Let moderators edit another member's planet identity#1660
SpikeViper merged 4 commits into
version/0.8.0from
fix/mod-edit-identity

Conversation

@SkyJoshua

Copy link
Copy Markdown
Contributor

Summary

Closes #1657 - moderators previously had no way to fix an inappropriate Planet Identity (per-planet nickname/avatar) other than telling the user to change it themselves.

  • Adds a new Manage Identity planet permission. A member with it can edit another member's planet nickname and avatar (including uploading a new image, not just resetting), gated behind the same authority check used for Kick/Ban (can't act on an equal-or-higher-ranked member), and logged to the moderation audit log.
  • Surfaced as an "Edit Identity" option on the member context menu, hidden on yourself and hidden without the permission.
  • Extracted the nickname/avatar editor out of the self-edit Settings page into a shared EditIdentity.razor component, reused by both the existing settings page and the new moderator modal, so there's one copy of the save logic instead of two.
  • Along the way, fixed a bug where changing your own nickname (or avatar-reset) didn't show up live in the member list or open chat tabs until you closed and reopened them - root cause was the client pre-mutating its own cached copy before the realtime update round-tripped back, so the diff never saw a change for your own client. Same underlying bug also affected the global account username change; fixed that too.
  • Also fixed a couple of smaller bugs found while testing: the "reset avatar" action was showing a raw JSON dump instead of a success message, and the moderator modal was missing CSS after the extraction (Blazor's per-component CSS scoping needed the styles to move with the markup).

Note: this is my own interpretation of how to handle this - permission shape, authority-check reuse, and the shared-component split were all judgment calls on my end, so if there's a preferred approach or convention I should be following instead, happy to adjust.

Test plan

  • Grant "Manage Identity" to a test role; confirm "Edit Identity" appears on other members' context menu for that role, not on yourself, and not without the permission
  • Edit another member's nickname and avatar (upload + "use profile avatar") as a mod; confirm both persist and update live in the member list/chat without a reload
  • Confirm a mod can't edit a member with equal/higher role authority
  • Confirm moderation audit log gets an entry for mod-initiated edits, but not self-edits
  • Confirm self-editing via Settings → Planet Identity still works unchanged, no permission required
  • Confirm changing your global username updates live everywhere without a reload
  • Confirm Kick/Ban still work normally (adjacent code was touched)

Adds a Manage Identity permission so mods can reset an inappropriate
nickname or avatar instead of just reporting it (issue #1657). Same
authority check as kick/ban, and logged to the moderation audit log.

Also fixed nickname/avatar changes not showing up live in the member
list or chat until you reopened them - same root cause hit the global
username change too, fixed that alongside it.
@SkyJoshua
SkyJoshua requested a review from a team as a code owner August 4, 2026 02:36
Comment thread Valour/Client/Components/Menus/Modals/Users/Edit/EditIdentity.razor Outdated
Comment thread Valour/Client/Components/Menus/Modals/Users/Edit/EditIdentity.razor Outdated
Comment thread Valour/Sdk/Client/ValourClient.cs Outdated
Comment on lines +311 to +312
// You can always edit your own avatar, so we only check permissions
// if you are not the same as the target

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I get it right, revoking identity editing permission from the user is not available yet and might be implemented in future.

Comment on lines +631 to +632

public static readonly PlanetPermission ManageIdentity = new PlanetPermission(0x1000000, "Manage Identity", "Allow members to edit other members' planet nickname and avatar.");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm... so the permissions are sorted by their mask rather than physical order? I'm looking at additions at lines 505 and 562 with neighboring lines.

…razor

Co-authored-by: Vitaly Orekhov <vkvo2000@vivaldi.net>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deploying valour-marketing with  Cloudflare Pages  Cloudflare Pages

Latest commit: eecb4b0
Status: ✅  Deploy successful!
Preview URL: https://79697754.valour-marketing.pages.dev
Branch Preview URL: https://fix-mod-edit-identity.valour-marketing.pages.dev

View logs

SkyJoshua and others added 2 commits August 20, 2026 22:10
…razor

Co-authored-by: Vitaly Orekhov <vkvo2000@vivaldi.net>
Co-authored-by: Vitaly Orekhov <vkvo2000@vivaldi.net>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deploying valour with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7f85e5f
Status: ✅  Deploy successful!
Preview URL: https://17a34f57.valour.pages.dev
Branch Preview URL: https://fix-mod-edit-identity.valour.pages.dev

View logs

@SpikeViper
SpikeViper merged commit 1600e9c into version/0.8.0 Sep 7, 2026
2 checks passed
@SpikeViper
SpikeViper deleted the fix/mod-edit-identity branch September 7, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

📦 Feature - Nickname/Planet Identity changing for planet moderators

3 participants