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
- Enable Accounts_AllowRealNameChange if self-service rename should work
- Hide/disable the name field when the setting is false (it is exposed in public settings)
- 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
- Hide the name field when Accounts_AllowRealNameChange is false in public settings
- Prefer /v1/users.updateOwnBasicInfo for new integrations - setRealName is deprecated
- On LDAP-synced workspaces treat name as directory-owned and read-only in the UI
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
- error-not-allowed
- error-action-not-allowed
- error-could-not-change-name
- SlackBridge_disabled
- error-not-allowed
AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18).
Data as JSON: /api/errors/8097122ca4eb17c7.
Report an issue: GitHub.