RocketChat/Rocket.Chat · error · Meteor.Error

error-not-allowed

error-not-allowed

Error message

Not allowed

What it means

setRealName refuses every name change when the workspace setting Accounts_AllowRealNameChange is false. The setting is read per-call from server settings, so a disabled value blocks the method even for otherwise valid names.

Source

Thrown at apps/meteor/server/meteor-methods/users/setRealName.ts:27

declare module '@rocket.chat/ddp-client' {
	// eslint-disable-next-line @typescript-eslint/naming-convention
	interface ServerMethods {
		setRealName(name: string): string;
	}
}

Meteor.methods<ServerMethods>({
	async setRealName(name) {
		methodDeprecationLogger.method('setRealName', '9.0.0', '/v1/users.updateOwnBasicInfo');
		check(name, String);
		const userId = Meteor.userId();
		if (!userId) {
			throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'setRealName' });
		}

		if (!settings.get('Accounts_AllowRealNameChange')) {
			throw new Meteor.Error('error-not-allowed', 'Not allowed', { method: 'setRealName' });
		}

		if (!(await setRealName(userId, name))) {
			throw new Meteor.Error('error-could-not-change-name', 'Could not change name', {
				method: 'setRealName',
			});
		}

		return name;
	},
});

RateLimiter.limitMethod('setRealName', 1, 1000, {
	userId: () => true,
});

View on GitHub (pinned to b2c16d5842)

Solutions

  1. Enable Accounts_AllowRealNameChange if self-service rename should work
  2. Hide/disable the name field when the setting is false (it is exposed in public settings)
  3. Use /v1/users.updateOwnBasicInfo or an admin-only users.update flow when names are centrally managed
Defensive patterns

Strategy: validation

Validate before calling

const allowRealNameChange = publicSettings['Accounts_AllowRealNameChange'] === true;
if (!allowRealNameChange) {
  disableField('realname'); // do not submit realname at all
}

Try / catch

catch (err) {
  if (err instanceof Meteor.Error && err.error === 'error-not-allowed') {
    showNotice('Name change is disabled on this server');
  }
}

Prevention

When it happens

Trigger: Meteor.call('setRealName', name) or a saveUserProfile submit that includes realname, while Accounts_AllowRealNameChange is disabled in Administration > Accounts.

Common situations: LDAP-managed workspaces that lock display names to the directory source; default setups where the toggle is off; profile UIs that still render an editable name field.

Related errors


AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18). Data as JSON: /api/errors/8097122ca4eb17c7. Report an issue: GitHub.