{"record":{"id":"cf59fda2c6d1cd44","repo":"RocketChat/Rocket.Chat","slug":"error-not-allowed-cf59fd","errorCode":"error-not-allowed","errorMessage":"WebDAV Integration Not Allowed","messagePattern":"WebDAV Integration Not Allowed","errorType":"error_code","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/bridges/webdav/methods/getWebdavFilePreview.ts","lineNumber":28,"sourceCode":"declare module '@rocket.chat/ddp-client' {\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\tinterface ServerMethods {\n\t\tgetWebdavFilePreview(accountId: IWebdavAccount['_id'], path: string): { success: true; data: ArrayBuffer } | undefined;\n\t}\n}\n\nMeteor.methods<ServerMethods>({\n\tasync getWebdavFilePreview(accountId, path) {\n\t\tconst userId = Meteor.userId();\n\n\t\tif (!userId) {\n\t\t\tthrow new Meteor.Error('error-invalid-user', 'Invalid User', {\n\t\t\t\tmethod: 'getWebdavFilePreview',\n\t\t\t});\n\t\t}\n\n\t\tif (!settings.get('Webdav_Integration_Enabled') || !settings.get('Accounts_OAuth_Nextcloud_URL')) {\n\t\t\tthrow new Meteor.Error('error-not-allowed', 'WebDAV Integration Not Allowed', {\n\t\t\t\tmethod: 'getWebdavFilePreview',\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: 'getWebdavFilePreview',\n\t\t\t});\n\t\t}\n\n\t\ttry {\n\t\t\tconst cred = getWebdavCredentials(account);\n\t\t\tconst client = createClient(account.serverURL, cred);\n\t\t\tconst serverURL = settings.get('Accounts_OAuth_Nextcloud_URL');\n\t\t\tconst res = await client.customRequest(`${serverURL}/index.php/core/preview.png?file=${path}&x=64&y=64`, {\n\t\t\t\tmethod: 'GET',\n\t\t\t\tresponseType: 'arraybuffer',","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/bridges/webdav/methods/getWebdavFilePreview.ts#L10-L46","documentation":"getWebdavFilePreview is gated on two settings: Webdav_Integration_Enabled must be true AND Accounts_OAuth_Nextcloud_URL must be set. The preview flow builds a URL against the Nextcloud host (`${serverURL}/index.php/core/preview.png?file=...`), so without a configured Nextcloud base URL the method refuses with error-not-allowed even though generic WebDAV browsing may work.","triggerScenarios":"Admin disabled Webdav_Integration_Enabled; Accounts_OAuth_Nextcloud_URL was never set because the deployment uses a non-Nextcloud WebDAV provider; settings changed while a user had the WebDAV file picker open.","commonSituations":"Using generic WebDAV (e.g. Apache/mod_dav, Sabre) where no Nextcloud URL exists, so previews are structurally unavailable; partially completed Nextcloud OAuth setup; the toggle was switched off temporarily during maintenance.","solutions":["Enable Webdav_Integration_Enabled under Administration > WebDAV Integration","Set Accounts_OAuth_Nextcloud_URL to the Nextcloud base URL the account was authorized against","If the provider is not Nextcloud, hide/disable the preview affordance in the UI — previews are Nextcloud-only by construction"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { settings } from '../../../settings/server';\n\n// expose capability to the UI instead of letting it discover the error\nexport const webdavPreviewAvailable = (): boolean =>\n  Boolean(settings.get('Webdav_Integration_Enabled')) &&\n  Boolean(settings.get('Accounts_OAuth_Nextcloud_URL'));","typeGuard":null,"tryCatchPattern":"try {\n  await Meteor.callAsync('getWebdavFilePreview', accountId, path);\n} catch (e: any) {\n  if (e?.error === 'error-not-allowed') {\n    // hide preview UI; integration disabled or Nextcloud URL missing\n  }\n}","preventionTips":["Expose both settings as a public capability flag so the UI can hide preview actions entirely","Remember previews are Nextcloud-only: for generic WebDAV providers, never surface the preview action"],"tags":["webdav","configuration","settings","nextcloud"],"backgroundTag":"missing-configuration","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}