{"record":{"id":"a21c673a431801cf","repo":"RocketChat/Rocket.Chat","slug":"error-not-allowed-a21c67","errorCode":"error-not-allowed","errorMessage":"Not allowed","messagePattern":"Not allowed","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/meteor-methods/users/saveUserProfile.ts","lineNumber":43,"sourceCode":"\nasync function saveUserProfile(\n\tthis: AuthenticatedContext,\n\tsettings: {\n\t\temail?: string;\n\t\tusername?: string;\n\t\trealname?: string;\n\t\tnewPassword?: string;\n\t\tstatusText?: string;\n\t\tstatusType?: string;\n\t\tbio?: string;\n\t\tnickname?: string;\n\t},\n\tcustomFields: Record<string, unknown>,\n\t..._: unknown[]\n) {\n\tconst unset: UpdateFilter<IUser> = {};\n\tif (!rcSettings.get<boolean>('Accounts_AllowUserProfileChange')) {\n\t\tthrow new Meteor.Error('error-not-allowed', 'Not allowed', {\n\t\t\tmethod: 'saveUserProfile',\n\t\t});\n\t}\n\n\tif (!this.userId) {\n\t\tthrow new Meteor.Error('error-invalid-user', 'Invalid user', {\n\t\t\tmethod: 'saveUserProfile',\n\t\t});\n\t}\n\n\tawait validateUserEditing(this.userId, {\n\t\t_id: this.userId,\n\t\temail: settings.email,\n\t\tusername: settings.username,\n\t\tname: settings.realname,\n\t\tpassword: settings.newPassword,\n\t\tstatusText: settings.statusText,\n\t});","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/meteor-methods/users/saveUserProfile.ts#L25-L61","documentation":"Thrown by 'saveUserProfile' when the setting Accounts_AllowUserProfileChange is false. It is a global feature gate checked before the user-id guard: with profile changes disabled workspace-wide, nobody (including the owner of the profile) may edit profile fields through this method. There is no per-user override permission at this checkpoint.","triggerScenarios":"Meteor.call('saveUserProfile', ...) or the account profile form while Administration > Accounts > 'Allow User Profile Change' is false; workspaces that sync profile data from LDAP/SAML and lock local edits.","commonSituations":"Directory-managed deployments locking name/email/username to the IdP; UI still rendering editable profile fields after the admin disabled changes.","solutions":["If local profile edits should be allowed: enable Administration > Accounts > 'Allow User Profile Change'.","If profiles are IdP-managed: make the profile form read-only in your UI/fork instead of calling the method.","Admins needing to fix a profile can use PUT /api/v1/users.update with admin credentials, which is not blocked by this setting."],"exampleFix":"// before: form always editable\n{canEdit ? <ProfileForm onSubmit={saveUserProfile} /> : <ReadonlyProfile />}\n\n// after: tie editability to the public setting\nconst canEdit = publicSettings['Accounts_AllowUserProfileChange'] === true;\n{canEdit ? <ProfileForm onSubmit={saveUserProfile} /> : <ReadonlyProfile />}","handlingStrategy":"validation","validationCode":"const profileChangeAllowed = publicSettings['Accounts_AllowUserProfileChange'] === true;\nif (!profileChangeAllowed) {\n  renderReadOnlyProfile();\n} else {\n  renderEditableProfile({ onSubmit: saveUserProfile });\n}","typeGuard":null,"tryCatchPattern":"try {\n  await Meteor.callAsync('saveUserProfile', settings, customFields);\n} catch (e) {\n  if ((e as Meteor.Error).error === 'error-not-allowed') {\n    showError('Profile editing is disabled on this server.');\n    renderReadOnlyProfile();\n  }\n}","preventionTips":["Drive profile editability from the Accounts_AllowUserProfileChange public setting","On IdP-synced workspaces, render profiles read-only by design","Admin edits should go through PUT /api/v1/users.update"],"tags":["profile","settings","accounts","meteor-method"],"backgroundTag":"profile-editing-disabled","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}