RocketChat / RocketChat/Rocket.Chat
Admin can't change its own username when 'Allow Username Change' is disabled
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:
- Be in the
Admingroup - Turn off:
Accounts->Allow Username Change - Select yourself in the
Userstab and click onEdit - 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:

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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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