new PermissionImport()
Permission Import Controller
Handles permission policy import workflow with preview modal showing what policies will be added and removed during the sync operation.
Features:
- File upload handling for JSON import files
- Preview analysis showing additions and removals
- Confirmation modal before applying changes
- Progress feedback during import
Extends
- Controller
Members
boundHandleFileSelect :function|null
Bound handleFileSelect reference for cleanup
- function |
null
boundTriggerFileSelect :function|null
Bound triggerFileSelect reference for cleanup
- function |
null
externalFileInput :HTMLInputElement|null
External file input reference
- HTMLInputElement |
null
externalImportButton :HTMLElement|null
External import button reference
- HTMLElement |
null
importData :string|null
Base64 encoded import data for final submission
- string |
null
Methods
cancelImport()
Cancel import operation Closes modal and resets state
(async) confirmImport()
Confirm and execute the import Sends the import data to the server for processing
connect()
Initialize controller
disconnect()
Clean up on disconnect
displayPreview(changes)
Display preview information in modal
| Name | Type | Description |
|---|---|---|
changes | Object | The changes object from preview response |
escapeHtml(text) → {string}
Escape HTML to prevent XSS
| Name | Type | Description |
|---|---|---|
text | string | Text to escape |
Escaped text
- Type:
- string
formatPolicyName(policyClass) → {string}
Format policy class name for display Extracts just the class name from full namespace
| Name | Type | Description |
|---|---|---|
policyClass | string | Full policy class name |
Formatted class name
- Type:
- string
getFileInput() → {HTMLInputElement|null}
Get the file input element (either external or target)
- Type:
- HTMLInputElement |
null
handleFileSelect(event)
Handle file selection Validates file type and initiates preview request
| Name | Type | Description |
|---|---|---|
event | Event | Change event from file input |
hideLoadingOverlay()
Hide loading overlay
hideModal()
Hide the preview modal
(async) previewImport(file)
Send file to server for preview analysis
| Name | Type | Description |
|---|---|---|
file | File | The uploaded JSON file |
resetFileInput()
Reset the file input value
resetModalContent()
Reset modal content for next use
showLoadingOverlay()
Show loading overlay during processing
showModal()
Show the preview modal
triggerFileSelect()
Trigger file input click Called when the import button is clicked