{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "docx-editor-document-protection",
  "framework": "aspnet-core",
  "type": "registry:component",
  "component": "DocxEditor",
  "variant": "document-protection",
  "dependencies": [
    "Syncfusion.AspNetCore.DocumentEditor",
    "Syncfusion.AspNetCore.Inputs",
    "Syncfusion.AspNetCore.DropDowns"
  ],
  "description": "Document editor demonstrating document protection settings and restricted editing modes.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 3 (v35.1.37)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": false,
    "platformIndex": "https://ai.syncfusion.com/aspnet-core/llms.txt",
    "skillPack": "syncfusion/aspnetcore-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/aspnet-core/docx-editor-document-protection.md"
  },
  "files": [
    {
      "target": "src/components/docx-editor-document-protection/docx-editor.cshtml",
      "content": "@page\n@namespace aspnet_core.DocxEditor.DocumentProtection\n@using Syncfusion.EJ2\n\n    <div class=\"control-section\">\n        <div class=\"content-wrapper\">\n            <div class=\"heading-section\">\n                <h5><b>User Permission</b></h5>\n            </div>\n            <div class=\"control-label\"><b>Current User</b></div>\n            <ejs-dropdownlist id=\"ddlelement\" placeholder=\"Select User\" index=\"0\" dataSource=\"@(new string[] { \"user.one@example.com\", \"user.two@example.com\" })\"></ejs-dropdownlist>\n            <div class=\"control-label\"><b>User Color</b></div>\n            <ejs-colorpicker id=\"color-picker\" value=\"#b70f34\"></ejs-colorpicker>\n        </div>\n        <div id='documenteditor_titlebar' class=\"e-de-ctn-title\"></div>\n        <ejs-documenteditorcontainer id=\"container\" height=\"590px\" enableToolbar=\"true\"></ejs-documenteditorcontainer>\n    </div>\n\n    <script>\n        document.addEventListener('DOMContentLoaded', function () {\n            var container = document.getElementById('container').ej2_instances[0];\n            if (!container) return;\n            // Lock the entire document so the selected user is the only\n            // one allowed to make changes.\n            container.documentEditor.editor.enforceProtection('password123', 'ReadOnly');\n            var userMenu = document.getElementById('ddlelement').ej2_instances[0];\n            var colorPicker = document.getElementById('color-picker').ej2_instances[0];\n            userMenu.change = function (e) {\n                if (container && container.documentEditor) {\n                    container.documentEditor.currentUser = e.value;\n                }\n            };\n            colorPicker.change = function (e) {\n                if (container && container.documentEditor && e.currentValue) {\n                    container.documentEditor.userColor = e.currentValue.hex;\n                }\n            };\n        });\n    </script>\n"
    }
  ]
}