RocketChat / RocketChat/Rocket.Chat

Admin can't change its own username when 'Allow Username Change' is disabled

Open
#22,088 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

When trying to change your own username as an administrator, with the option Allow Username Change is disabled, an error pops up saying this action is not allowed. But changing other usernames (including other administrator's usernames) works just fine.

Steps to reproduce:
  1. Be in the Admin group
  2. Turn off: Accounts -> Allow Username Change
  3. Select yourself in the Users tab and click on Edit
  4. Edit your username to a different one and click on Save
Expected behavior:

As an administrator it should always be possible to change its own name or the name of others, regardless of the Allow Username Change option.

Actual behavior:

The own username cannot be changed. Yielding to this error message:
grafik

Changing the username of another admin user is possible, as expected.

Server Setup Information:
  • Version of Rocket.Chat Server: 3.14.1
  • Operating System: Linux Debian
  • Deployment Method: tar
  • Number of Running Instances: 1
  • DB Replicaset Oplog: n.a.
  • NodeJS Version: v12.22.1
  • MongoDB Version: 4.0.23
Client Setup Information
  • Desktop App or Browser Version: Desktop App, Version 3.1.1
  • Operating System: Windows 10
Additional context

n.a.

Relevant logs:

n.a.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue from the Users tab with Accounts → Allow Username Change disabled, then trace the save path for editing the current administrator versus another user. Done means an administrator can change their own username while the setting remains enforced for non-administrators; verify both cases with the relevant user-management tests if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authorization, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.