|
| 1 | +<!DOCTYPE html> |
| 2 | +<html xmlns="http://www.w3.org/1999/xhtml"> |
| 3 | +<head> |
| 4 | + <title>User based restrict editing and approval workflow - JavaScript (ES5) DOCX Editor</title> |
| 5 | + <meta charset="utf-8" /> |
| 6 | + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" /> |
| 7 | + <meta name="description" content="Sample demonstrating user-based document restrictions and approval workflows with the Syncfusion JavaScript (ES5) DOCX Editor" /> |
| 8 | + <meta name="author" content="Syncfusion" /> |
| 9 | + <!-- EJ2 Document Editor dependent theme --> |
| 10 | + <link href="https://cdn.syncfusion.com/ej2/33.2.3/ej2-base/styles/tailwind3.css" rel="stylesheet" type="text/css" rel="nofollow" /> |
| 11 | + <link href="https://cdn.syncfusion.com/ej2/33.2.3/ej2-buttons/styles/tailwind3.css" rel="stylesheet" type="text/css" rel="nofollow" /> |
| 12 | + <link href="https://cdn.syncfusion.com/ej2/33.2.3/ej2-inputs/styles/tailwind3.css" rel="stylesheet" type="text/css" rel="nofollow" /> |
| 13 | + <link href="https://cdn.syncfusion.com/ej2/33.2.3/ej2-popups/styles/tailwind3.css" rel="stylesheet" type="text/css" rel="nofollow" /> |
| 14 | + <link href="https://cdn.syncfusion.com/ej2/33.2.3/ej2-lists/styles/tailwind3.css" rel="stylesheet" type="text/css" rel="nofollow" /> |
| 15 | + <link href="https://cdn.syncfusion.com/ej2/33.2.3/ej2-navigations/styles/tailwind3.css" rel="stylesheet" type="text/css" rel="nofollow" /> |
| 16 | + <link href="https://cdn.syncfusion.com/ej2/33.2.3/ej2-splitbuttons/styles/tailwind3.css" rel="stylesheet" type="text/css" rel="nofollow" /> |
| 17 | + <link href="https://cdn.syncfusion.com/ej2/33.2.3/ej2-dropdowns/styles/tailwind3.css" rel="stylesheet" type="text/css" rel="nofollow" /> |
| 18 | + <!-- EJ2 Document Editor theme --> |
| 19 | + <link href="https://cdn.syncfusion.com/ej2/33.2.3/ej2-documenteditor/styles/tailwind3.css" rel="stylesheet" type="text/css" rel="nofollow" /> |
| 20 | + <!-- EJ2 Document Editor dependent scripts --> |
| 21 | + <script src="https://cdn.syncfusion.com/ej2/33.2.3/ej2-base/dist/global/ej2-base.min.js" type="text/javascript"></script> |
| 22 | + <script src="https://cdn.syncfusion.com/ej2/33.2.3/ej2-data/dist/global/ej2-data.min.js" type="text/javascript"></script> |
| 23 | + <script src="https://cdn.syncfusion.com/ej2/33.2.3/ej2-svg-base/dist/global/ej2-svg-base.min.js" type="text/javascript"></script> |
| 24 | + <script src="https://cdn.syncfusion.com/ej2/33.2.3/ej2-file-utils/dist/global/ej2-file-utils.min.js" type="text/javascript"></script> |
| 25 | + <script src="https://cdn.syncfusion.com/ej2/33.2.3/ej2-compression/dist/global/ej2-compression.min.js" type="text/javascript"></script> |
| 26 | + <script src="https://cdn.syncfusion.com/ej2/33.2.3/ej2-pdf-export/dist/global/ej2-pdf-export.min.js" type="text/javascript"></script> |
| 27 | + <script src="https://cdn.syncfusion.com/ej2/33.2.3/ej2-buttons/dist/global/ej2-buttons.min.js" type="text/javascript"></script> |
| 28 | + <script src="https://cdn.syncfusion.com/ej2/33.2.3/ej2-popups/dist/global/ej2-popups.min.js" type="text/javascript"></script> |
| 29 | + <script src="https://cdn.syncfusion.com/ej2/33.2.3/ej2-splitbuttons/dist/global/ej2-splitbuttons.min.js" type="text/javascript"></script> |
| 30 | + <script src="https://cdn.syncfusion.com/ej2/33.2.3/ej2-inputs/dist/global/ej2-inputs.min.js" type="text/javascript"></script> |
| 31 | + <script src="https://cdn.syncfusion.com/ej2/33.2.3/ej2-lists/dist/global/ej2-lists.min.js" type="text/javascript"></script> |
| 32 | + <script src="https://cdn.syncfusion.com/ej2/33.2.3/ej2-navigations/dist/global/ej2-navigations.min.js" type="text/javascript"></script> |
| 33 | + <script src="https://cdn.syncfusion.com/ej2/33.2.3/ej2-dropdowns/dist/global/ej2-dropdowns.min.js" type="text/javascript"></script> |
| 34 | + <script src="https://cdn.syncfusion.com/ej2/33.2.3/ej2-calendars/dist/global/ej2-calendars.min.js" type="text/javascript"></script> |
| 35 | + <script src="https://cdn.syncfusion.com/ej2/33.2.3/ej2-charts/dist/global/ej2-charts.min.js" type="text/javascript"></script> |
| 36 | + <script src="https://cdn.syncfusion.com/ej2/33.2.3/ej2-office-chart/dist/global/ej2-office-chart.min.js" type="text/javascript"></script> |
| 37 | + <!-- EJ2 Document Editor script --> |
| 38 | + <script src="https://cdn.syncfusion.com/ej2/33.2.3/ej2-documenteditor/dist/global/ej2-documenteditor.min.js" type="text/javascript"></script> |
| 39 | + |
| 40 | + <style> |
| 41 | + body { |
| 42 | + margin: 0; |
| 43 | + font-family: 'Segoe UI', Helvetica, Arial, sans-serif; |
| 44 | + background-color: #f4f5f7; |
| 45 | + } |
| 46 | + |
| 47 | + .sample-header { |
| 48 | + padding: 16px 24px 8px; |
| 49 | + background-color: #ffffff; |
| 50 | + border-bottom: 1px solid #e0e0e0; |
| 51 | + } |
| 52 | + |
| 53 | + .sample-header h1 { |
| 54 | + margin: 0 0 4px; |
| 55 | + font-size: 20px; |
| 56 | + font-weight: 600; |
| 57 | + color: #1a202c; |
| 58 | + } |
| 59 | + |
| 60 | + .sample-header p { |
| 61 | + margin: 0; |
| 62 | + font-size: 13px; |
| 63 | + color: #5f6b7a; |
| 64 | + } |
| 65 | + |
| 66 | + .sample-toolbar { |
| 67 | + display: flex; |
| 68 | + align-items: center; |
| 69 | + gap: 10px; |
| 70 | + padding: 10px 24px; |
| 71 | + background-color: #ffffff; |
| 72 | + border-bottom: 1px solid #e0e0e0; |
| 73 | + } |
| 74 | + |
| 75 | + .sample-toolbar label { |
| 76 | + font-size: 13px; |
| 77 | + font-weight: 600; |
| 78 | + color: #1a202c; |
| 79 | + } |
| 80 | + |
| 81 | + .sample-toolbar select { |
| 82 | + min-width: 160px; |
| 83 | + height: 30px; |
| 84 | + padding: 2px 6px; |
| 85 | + border: 1px solid #c3cdd5; |
| 86 | + border-radius: 4px; |
| 87 | + font-size: 13px; |
| 88 | + } |
| 89 | + |
| 90 | + .permission-banner { |
| 91 | + font-size: 12px; |
| 92 | + color: #5f6b7a; |
| 93 | + } |
| 94 | + |
| 95 | + .sample-content { |
| 96 | + display: flex; |
| 97 | + align-items: flex-start; |
| 98 | + } |
| 99 | + |
| 100 | + .editor-holder { |
| 101 | + flex: 1; |
| 102 | + min-width: 0; |
| 103 | + } |
| 104 | + |
| 105 | + .permission-holder { |
| 106 | + flex: 1; |
| 107 | + padding: 0; |
| 108 | + } |
| 109 | + |
| 110 | + .permission-table { |
| 111 | + width: 100%; |
| 112 | + border-collapse: collapse; |
| 113 | + font-size: 12px; |
| 114 | + } |
| 115 | + |
| 116 | + .permission-table th, |
| 117 | + .permission-table td { |
| 118 | + padding: 6px 8px; |
| 119 | + border: 1px solid #e0e0e0; |
| 120 | + text-align: left; |
| 121 | + vertical-align: top; |
| 122 | + } |
| 123 | + |
| 124 | + .permission-table th { |
| 125 | + background-color: #f4f5f7; |
| 126 | + font-weight: 600; |
| 127 | + color: #1a202c; |
| 128 | + } |
| 129 | + |
| 130 | + .permission-table td:nth-child(3) { |
| 131 | + word-break: break-all; |
| 132 | + } |
| 133 | + </style> |
| 134 | +</head> |
| 135 | +<body> |
| 136 | + <div class="sample-header"> |
| 137 | + <h1>User based restrict editing and approval workflow in JavaScript DOCX Editor</h1> |
| 138 | + <p> |
| 139 | + Select a user to switch between role-based editing restrictions: price-only editing with editable |
| 140 | + ranges, tracked changes review, comments-only review, full editing and read-only access. |
| 141 | + </p> |
| 142 | + </div> |
| 143 | + <div class="sample-toolbar"> |
| 144 | + <div class="permission-holder"> |
| 145 | + <table class="permission-table"> |
| 146 | + <thead> |
| 147 | + <tr> |
| 148 | + <th>User</th> |
| 149 | + <th>Role</th> |
| 150 | + <th>Email</th> |
| 151 | + <th>Permissions</th> |
| 152 | + </tr> |
| 153 | + </thead> |
| 154 | + <tbody> |
| 155 | + <tr> |
| 156 | + <td>Nancy</td> |
| 157 | + <td>Price Editor</td> |
| 158 | + <td>nancy@example.com</td> |
| 159 | + <td>Can edit only the price values (marked editable ranges)</td> |
| 160 | + </tr> |
| 161 | + <tr> |
| 162 | + <td>Andrew</td> |
| 163 | + <td>Reviewer</td> |
| 164 | + <td>andrew@example.com</td> |
| 165 | + <td>All edits are tracked; cannot accept/reject revisions</td> |
| 166 | + </tr> |
| 167 | + <tr> |
| 168 | + <td>Steven</td> |
| 169 | + <td>Commenter</td> |
| 170 | + <td>steven@example.com</td> |
| 171 | + <td>Can insert comments only; cannot edit content</td> |
| 172 | + </tr> |
| 173 | + <tr> |
| 174 | + <td>Michael</td> |
| 175 | + <td>Editor</td> |
| 176 | + <td>michael@example.com</td> |
| 177 | + <td>Full editing (approves the tracked changes)</td> |
| 178 | + </tr> |
| 179 | + <tr> |
| 180 | + <td>Laura</td> |
| 181 | + <td>Viewer</td> |
| 182 | + <td>laura@example.com</td> |
| 183 | + <td>Read-only access to the document</td> |
| 184 | + </tr> |
| 185 | + </tbody> |
| 186 | + </table> |
| 187 | + </div> |
| 188 | + </div> |
| 189 | + <div class="sample-toolbar"> |
| 190 | + <label for="userSelect">Signed in user:</label> |
| 191 | + <select id="userSelect" title="Choose the user whose permissions are applied"></select> |
| 192 | + <span id="permissionBanner" class="permission-banner"></span> |
| 193 | + </div> |
| 194 | + <div class="sample-content"> |
| 195 | + <div class="editor-holder"> |
| 196 | + <!-- Element which will render as Document Editor --> |
| 197 | + <div id="DocumentEditor"></div> |
| 198 | + </div> |
| 199 | + </div> |
| 200 | + |
| 201 | + <script src="data-document-protection.js" type="text/javascript"></script> |
| 202 | + <script src="index.js" type="text/javascript"></script> |
| 203 | +</body> |
| 204 | +</html> |
0 commit comments