Skip to content

Permission Dialog (Portals) ​

File Information ​

  • Path: components/dam/Dialogs/PermissionDialog.vue
  • Purpose: Select which brand portals an asset, folder, or collage is visible on

Overview ​

Previously a public/private toggle. Now redesigned as a "Portals" dialog — users choose which portals to publish content to by toggling individual portal switches. Content visibility is controlled per-portal rather than as a binary public/private flag.

Key Features ​

  1. Portal List — Fetches all portals for the workspace; displays each with its brand_name and primary_color accent
  2. Per-Portal Toggle — Each portal has its own switch; multiple portals can be selected simultaneously
  3. Bulk Resource Support — Accepts arrays of IDs (assetIds, folderIds, collectionIds), enabling bulk permission changes
  4. Nested Apply — Folders show an optional "Apply to all subfolders" toggle
  5. Locked State — Shows StaticPermissionDialog + UpgradePlanSection when canUpdateVisibility is false (plan limit)

Props ​

Actual props from development branch source:

javascript
{
  // dialog state
  dialog: Boolean,

  // resource arrays (bulk-capable)
  assetIds:      { type: Array, default: () => [] },
  folderIds:     { type: Array, default: () => [] },
  collectionIds: { type: Array, default: () => [] },

  // subfolder handling
  flag:            { type: String },   // 'folder' when opened from folder context
  isExistSubfolder: Boolean,

  workspaceId: [String, Number],
}

Data Properties ​

javascript
{
  saving: false,
  loadingPortals: false,
  portals: [],                  // portal objects fetched on open
  selectedPortals: [],          // array of portal IDs currently toggled on
  initialSelectedPortals: [],   // snapshot on open for change detection
  isNested: false,              // apply to subfolders toggle
  isAvailable: true,            // whether visibility is enabled at all
}

Key Methods ​

updateVisibility() ​

Saves portal visibility selection:

javascript
// API call
POST /digital-assets/permission/change-permission
{
  workspace_id,
  visibility: isAvailable ? 0 : 1,   // 0 = visible, 1 = hidden
  instance_ids: isAvailable ? selectedPortals : [],
  category_ids: folderIds,            // plural arrays
  collection_ids: collectionIds,
  asset_ids: assetIds,
  nested_apply: isNested ? 1 : 0,     // folders only
}

Emitted payload on success ​

javascript
this.$emit('permission-updated', {
  id: folderIds[0] || collectionIds[0] || assetIds[0],
  instance_visibility: selectedPortals,  // array of portal IDs now visible
  isNested: ...,
})

Events ​

EventPayloadWhen
close—Dialog dismissed
permission-updated{ id, instance_visibility, isNested }Save succeeded

Capability Required ​

canUpdateVisibility — checks folder_permission, asset_permission, or collage_permission via this.$canManageFolderPermission(workspace) etc. before showing the controls.

Usage ​

vue
<PermissionDialog
  :dialog="showPortalsDialog"
  :folder-ids="[selectedFolder.id]"
  :flag="'folder'"
  :is-exist-subfolder="hasSubfolders"
  :workspace-id="workspaceId"
  @close="showPortalsDialog = false"
  @permission-updated="handleVisibilityUpdated"
/>

Notes ​

  • AssetPermissionDialog.vue was deleted — the dedicated asset confirmation dialog no longer exists; confirmation is inline in this component
  • The dialog title is "Portals", not "Permissions"
  • Portal list loads when dialog opens; skeleton loaders shown during fetch
  • Portal primary_color used as left border accent on each portal row