PermissionImport

PermissionImport

new PermissionImport()

Description:
  • 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
Source:

Extends

  • Controller

Members

boundHandleFileSelect

Description:
  • Bound handleFileSelect reference for cleanup. @type {Function|null}

Source:

Bound handleFileSelect reference for cleanup. @type {Function|null}

boundTriggerFileSelect

Description:
  • Bound triggerFileSelect reference for cleanup. @type {Function|null}

Source:

Bound triggerFileSelect reference for cleanup. @type {Function|null}

externalFileInput

Description:
  • External file input reference. @type {HTMLInputElement|null}

Source:

External file input reference. @type {HTMLInputElement|null}

externalImportButton

Description:
  • External import button reference. @type {HTMLElement|null}

Source:

External import button reference. @type {HTMLElement|null}

importData

Description:
  • Base64 encoded import data for final submission. @type {string|null}

Source:

Base64 encoded import data for final submission. @type {string|null}

Methods

cancelImport()

Description:
  • Cancel import operation Closes modal and resets state

Source:

(async) confirmImport()

Description:
  • Confirm and execute the import Sends the import data to the server for processing

Source:

connect()

Description:
  • Initialize controller

Source:

disconnect()

Description:
  • Clean up on disconnect

Source:

displayPreview(changes)

Description:
  • Display preview information in modal

Source:
Parameters:
Name Type Description
changes Object

The changes object from preview response

escapeHtml(text) → {string}

Description:
  • Escape HTML to prevent XSS

Source:
Parameters:
Name Type Description
text string

Text to escape

Returns:

Escaped text

Type
string

formatPolicyName(policyClass) → {string}

Description:
  • Format policy class name for display Extracts just the class name from full namespace

Source:
Parameters:
Name Type Description
policyClass string

Full policy class name

Returns:

Formatted class name

Type
string

getFileInput() → {HTMLInputElement|null}

Description:
  • Get the file input element (either external or target)

Source:
Returns:
Type
HTMLInputElement | null

handleFileSelect(event)

Description:
  • Handle file selection Validates file type and initiates preview request

Source:
Parameters:
Name Type Description
event Event

Change event from file input

hideLoadingOverlay()

Description:
  • Hide loading overlay

Source:

hideModal()

Description:
  • Hide the preview modal

Source:

(async) previewImport(file)

Description:
  • Send file to server for preview analysis

Source:
Parameters:
Name Type Description
file File

The uploaded JSON file

resetFileInput()

Description:
  • Reset the file input value

Source:

resetModalContent()

Description:
  • Reset modal content for next use

Source:

showLoadingOverlay()

Description:
  • Show loading overlay during processing

Source:

showModal()

Description:
  • Show the preview modal

Source:

triggerFileSelect()

Description:
  • Trigger file input click Called when the import button is clicked

Source: