{"record":{"id":"7895d49c6fbcb5f4","repo":"RocketChat/Rocket.Chat","slug":"error-not-allowed-7895d4","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/getFileFromWebdav.ts","lineNumber":25,"sourceCode":"import { getWebdavCredentials } from '../lib/getWebdavCredentials';\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\tgetFileFromWebdav(accountId: IWebdavAccount['_id'], file: IWebdavNode): Promise<{ success: boolean; data: Uint8Array<ArrayBuffer> }>;\n\t}\n}\n\nMeteor.methods<ServerMethods>({\n\tasync getFileFromWebdav(accountId, file) {\n\t\tconst userId = Meteor.userId();\n\n\t\tif (!userId) {\n\t\t\tthrow new Meteor.Error('error-invalid-user', 'Invalid User', { method: 'getFileFromWebdav' });\n\t\t}\n\t\tif (!settings.get('Webdav_Integration_Enabled')) {\n\t\t\tthrow new Meteor.Error('error-not-allowed', 'WebDAV Integration Not Allowed', {\n\t\t\t\tmethod: 'getFileFromWebdav',\n\t\t\t});\n\t\t}\n\n\t\tconst account = await WebdavAccounts.findOneByIdAndUserId(accountId, userId, {});\n\t\tif (!account) {\n\t\t\tthrow new Meteor.Error('error-invalid-account', 'Invalid WebDAV Account', {\n\t\t\t\tmethod: 'getFileFromWebdav',\n\t\t\t});\n\t\t}\n\n\t\ttry {\n\t\t\tconst cred = getWebdavCredentials(account);\n\t\t\tconst client = new WebdavClientAdapter(account.serverURL, cred);\n\t\t\tconst fileContent = await client.getFileContents(file.filename);\n\t\t\tconst data = new Uint8Array(fileContent);\n\t\t\treturn { success: true, data };\n\t\t} catch (error) {","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/bridges/webdav/methods/getFileFromWebdav.ts#L7-L43","documentation":"getFileFromWebdav throws error-not-allowed ('WebDAV Integration Not Allowed') when the Webdav_Integration_Enabled setting is false. The toggle is checked immediately after the user check, so even users with valid, pre-existing WebDAV accounts cannot download files once the integration is disabled workspace-wide.","triggerScenarios":"Calling getFileFromWebdav while Webdav_Integration_Enabled is false — e.g. the admin disabled the integration after accounts were linked, or it was never enabled on this workspace.","commonSituations":"Disabling the integration to troubleshoot and forgetting that file downloads stop too; restored configs losing the setting; users with cached account data attempting downloads on a workspace where the feature was turned off.","solutions":["Re-enable WebDAV Integration under Admin → WebDAV Integration","Remove/hide WebDAV file-picker UI when the integration is off","Scripts should check the setting before attempting downloads"],"exampleFix":"// before\nawait call('getFileFromWebdav', accountId, file); // throws error-not-allowed\n\n// after\nconst { value } = await (await fetch('/api/v1/settings/Webdav_Integration_Enabled', { headers })).json();\nif (value !== true) throw new Error('WebDAV Integration is disabled');\nawait call('getFileFromWebdav', accountId, file);","handlingStrategy":"validation","validationCode":"const { value } = await (await fetch('/api/v1/settings/Webdav_Integration_Enabled', { headers: adminHeaders })).json();\nif (value !== true) throw new Error('WebDAV Integration is disabled');\nawait call('getFileFromWebdav', accountId, file);","typeGuard":null,"tryCatchPattern":"try {\n  await Meteor.callAsync('getFileFromWebdav', accountId, file);\n} catch (e) {\n  if (e.error === 'error-not-allowed') {\n    // integration disabled workspace-wide: disable the picker UI\n  }\n}","preventionTips":["Treat WebDAV downloads and uploads as one feature behind the toggle","Hide file-picker entry points when the integration is off","Scripts should read the setting before every WebDAV call"],"tags":["meteor","webdav","settings","feature-flag"],"backgroundTag":"integration-disabled","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}