{"record":{"id":"0df9ba6efc4eb749","repo":"octobercms/october","slug":"you-don-t-have-permission-to-manage-the-document-t","errorCode":null,"errorMessage":"You don't have permission to manage the document type: :doctype","messagePattern":"You don't have permission to manage the document type: :doctype","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/tailor/classes/editorextension/HasExtensionCrud.php","lineNumber":443,"sourceCode":"\n        $documentType = ApiHelpers::assertGetKey($metadata, 'type');\n        $templatePath = trim(ApiHelpers::assertGetKey($metadata, 'path'));\n\n        return [\n            $this->loadTemplate($documentType, $templatePath),\n            $documentType\n        ];\n    }\n\n    /**\n     * assertDocumentTypePermissions\n     */\n    private function assertDocumentTypePermissions($documentType)\n    {\n        $user = BackendAuth::getUser();\n\n        if (!EditorExtension::hasAccessToDocType($user, $documentType)) {\n            throw new ApplicationException(Lang::get(\n                'editor::lang.editor.error_no_doctype_permissions',\n                ['doctype' => $documentType]\n            ));\n        }\n    }\n\n    /**\n     * assertBlueprintPermissions checks permissions for blueprint file operations,\n     * resolving the document type from the request.\n     */\n    private function assertBlueprintPermissions()\n    {\n        $type = post('documentType', post('documentMetadata[documentType]'));\n\n        if (!$type) {\n            $type = EditorExtension::DOCUMENT_TYPE_BLUEPRINT;\n        }\n","sourceCodeStart":425,"sourceCodeEnd":461,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/tailor/classes/editorextension/HasExtensionCrud.php#L425-L461","documentation":"assertDocumentTypePermissions() resolves the backend user and delegates to EditorExtension::hasAccessToDocType(). Both tailor document types require the 'editor.tailor_blueprints' permission; a user whose roles lack it triggers an ApplicationException whose localized message is shown in the editor UI.","triggerScenarios":"A backend user whose role does not include the tailor blueprints permission opens or saves a blueprint (or theme blueprint) via the editor extension; also any custom handler calling assertDocumentTypePermissions() for such a user.","commonSituations":"Custom author/editor roles created without the Tailor permission; permission regrouping after an upgrade; shared accounts provisioned before Tailor was installed.","solutions":["Grant the role the Tailor blueprint permission (editor.tailor_blueprints) under Users → Roles → Permissions.","In custom UIs, check EditorExtension::hasAccessToDocType($user, $type) first and hide tailor document types for users without access."],"exampleFix":"// before: assuming access\n$this->assertDocumentTypePermissions($documentType);\n\n// after: gate the feature\n$user = BackendAuth::getUser();\nif (!EditorExtension::hasAccessToDocType($user, $documentType)) {\n    return response('No access to this document type', 403);\n}","handlingStrategy":"validation","validationCode":"$user = \\BackendAuth::getUser();\nif (!$user || !\\Tailor\\Classes\\EditorExtension::hasAccessToDocType($user, $documentType)) {\n    return response()->make('Forbidden', 403);\n}","typeGuard":"function canManageTailorBlueprints($user): bool\n{\n    return $user && $user->hasAnyAccess(['editor.tailor_blueprints']);\n}","tryCatchPattern":"try {\n    $this->assertDocumentTypePermissions($documentType);\n} catch (\\October\\Rain\\Exception\\ApplicationException $e) {\n    // show a friendly 'no permission' notice and hide tailor document types from this user\n}","preventionTips":["Add editor.tailor_blueprints to every role that needs blueprint editing.","Gate tailor UI entry points with hasAccessToDocType() so unauthorized users never see the actions."],"tags":["tailor","permissions","authorization","editor-extension"],"backgroundTag":"permission-denied","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}