{"record":{"id":"bcd1cd31c9eae853","repo":"RocketChat/Rocket.Chat","slug":"error-not-allowed-bcd1cd","errorCode":"error-not-allowed","errorMessage":"WebDAV Integration Not Allowed","messagePattern":"WebDAV Integration Not Allowed","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/bridges/webdav/methods/addWebdavAccount.ts","lineNumber":25,"sourceCode":"\nimport { settings } from '../../../settings';\nimport { WebdavClientAdapter } from '../lib/webdavClientAdapter';\n\ndeclare module '@rocket.chat/ddp-client' {\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\tinterface ServerMethods {\n\t\taddWebdavAccount(formData: IWebdavAccountPayload): boolean;\n\t\taddWebdavAccountByToken(data: IWebdavAccountPayload): boolean;\n\t}\n}\n\nexport const addWebdavAccountByToken = async (userId: string, data: IWebdavAccountPayload): Promise<boolean> => {\n\tif (!userId) {\n\t\tthrow new Meteor.Error('error-invalid-user', 'Invalid User', { method: 'addWebdavAccount' });\n\t}\n\n\tif (!settings.get('Webdav_Integration_Enabled')) {\n\t\tthrow new Meteor.Error('error-not-allowed', 'WebDAV Integration Not Allowed', {\n\t\t\tmethod: 'addWebdavAccount',\n\t\t});\n\t}\n\n\tcheck(\n\t\tdata,\n\t\tMatch.ObjectIncluding({\n\t\t\tserverURL: String,\n\t\t\ttoken: Match.ObjectIncluding({\n\t\t\t\taccess_token: String,\n\t\t\t\ttoken_type: String,\n\t\t\t\trefresh_token: Match.Optional(String),\n\t\t\t}),\n\t\t\tname: Match.Maybe(String),\n\t\t}),\n\t);\n\n\ttry {","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/server/bridges/webdav/methods/addWebdavAccount.ts#L7-L43","documentation":"Thrown as a feature gate by both addWebdavAccount and addWebdavAccountByToken before any network or DB work: the Rocket.Chat admin setting 'Webdav_Integration_Enabled' is falsy, so the WebDAV integration is disabled server-wide. It is a hard precondition check, not a transient failure. Re-enabling the setting makes the same call succeed without any other change.","triggerScenarios":"Calling the Meteor method 'addWebdavAccount' (with username/password) or 'addWebdavAccountByToken' (with an OAuth token) while settings.get('Webdav_Integration_Enabled') returns false. Triggered identically for any authenticated userId — the check runs after the userId guard but before input validation, so even well-formed payloads are rejected.","commonSituations":"Fresh install or workspace where the admin never enabled WebDAV; admin toggled it off after incidents; settings collection reset/restored from a backup that predates the feature; test/staging env seeded without the setting; an apps-engine or migration script calling the method on an instance where the setting was never flipped.","solutions":["As admin, open Administration > Workspace > Settings (or Integrations) and set 'WebDAV Integration Enabled' (key Webdav_Integration_Enabled) to true, then retry the call.","Set the value programmatically: settings.set('Webdav_Integration_Enabled', true) on the server, or push it via your deployment's settings preset/seed, then retry.","If the call comes from an automated client, have it preflight by reading the public WebDAV-enabled flag and surface 'contact admin to enable WebDAV' instead of attempting the method.","Confirm the setting is not being overridden by a deployment env var or a conflicting settings document in the DB after enabling it."],"exampleFix":"// before: client calls the method blindly\nMeteor.call('addWebdavAccount', payload, (err) => { /* err: error-not-allowed */ });\n\n// after: gate the call on the public setting exposed to the client\nif (Settings.getOrDefault('Webdav_Integration_Enabled', false) !== true) {\n  showWarning('WebDAV is disabled. Ask a workspace admin to enable it.');\n  return;\n}\nMeteor.call('addWebdavAccount', payload, ...);","handlingStrategy":"validation","validationCode":"// Server-side caller (e.g. an app or another method) — check before invoking\nimport { settings } from '../../../../../server/settings';\n\nfunction webdavEnabled(): boolean {\n  return settings.get('Webdav_Integration_Enabled') === true;\n}\n\nif (!webdavEnabled()) {\n  // do not call addWebdavAccount / addWebdavAccountByToken\n  throw new Error('WebDAV integration is disabled in workspace settings');\n}\n\n// Client-side caller — gate on the public setting exposed to the client\nif (window.__rocket_chat_settings?.Webdav_Integration_Enabled !== true) {\n  ui.alert('WebDAV is disabled. Ask an admin to enable it.');\n}","typeGuard":null,"tryCatchPattern":"// Wrap the method call; this error is deterministic, so do NOT retry.\ntry {\n  await Meteor.callAsync('addWebdavAccount', payload);\n} catch (e) {\n  if (e instanceof Meteor.Error && e.error === 'error-not-allowed') {\n    showUser('WebDAV is disabled. Ask a workspace admin to enable it in Settings.');\n    return;\n  }\n  throw e;\n}","preventionTips":["Treat Webdav_Integration_Enabled as a hard dependency: read it once at UI load and hide/disable the 'Add WebDAV account' action when it is off.","Seed the setting in your deployment presets so fresh environments do not surprise users with a disabled feature.","When writing apps-engine or automation code that calls these methods, assert the setting is true in a preflight and fail fast with a clear message rather than relying on the method error.","Do not retry on error-not-allowed — it is a configuration gate, not a transient condition."],"tags":["webdav","configuration","feature-flag","permissions","rocket-chat-settings"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}