Skip to content

Advance Share Dialog ​

File Information ​

  • Path: components/dam/Dialogs/AdvanceShareDialog.vue
  • Purpose: Advanced share settings with password protection, expiration, and access restrictions

Overview ​

The Advance Share Dialog component provides advanced configuration options for share links, including password protection, expiration dates, download restrictions, and access controls. It extends the basic share functionality with security and access management features.

Key Features ​

  1. Password Protection

    • Enable password protection
    • Set share password
    • Password strength indicator
    • Password confirmation
  2. Expiration Settings

    • Set expiration date
    • Set expiration time
    • Expiration notifications
    • Auto-expiration handling
  3. Download Restrictions

    • Hide download option
    • Disable download
    • View-only access
    • Download permissions
  4. Access Restrictions

    • Domain restrictions
    • IP restrictions
    • Access limits
    • View count limits
  5. Advanced Permissions

    • Custom permissions
    • Role-based access
    • User-specific access
    • Permission inheritance

Props ​

javascript
{
  dialog: {
    type: Boolean,
    default: false
  },
  shareLink: {
    type: Object,
    default: null
    // Existing share link to update
  },
  asset: {
    type: Object,
    required: true
  },
  workspaceId: {
    type: [String, Number],
    required: true
  }
}

Data Properties ​

javascript
{
  form: {
    password: '',
    password_confirmation: '',
    expires_at: null,
    hide_download: false,
    domain_restrictions: [],
    access_limit: null,
    view_limit: null
  },
  saving: false,      // Saving state
  errors: {}         // Form errors
}

Computed Properties ​

isFormValid ​

Validates form data

passwordStrength ​

Returns password strength indicator

expirationDate ​

Returns formatted expiration date

Methods ​

saveAdvancedSettings() ​

Saves advanced share settings:

  • Validates form
  • Updates share link via API
  • Applies settings
  • Shows success message
  • Handles errors

Updates share link with settings:

  • Merges settings with share link
  • Calls update API
  • Refreshes share link
  • Handles errors

validatePassword() ​

Validates password:

  • Checks password strength
  • Confirms password match
  • Returns validation result

API Endpoints ​

  • Endpoint: PUT /digital-assets/share-link/update
  • Request Body:
    json
    {
      "share_link_id": 123,
      "password": "secure-password",
      "expires_at": "2024-12-31T23:59:59Z",
      "hide_download": true,
      "domain_restrictions": ["example.com"],
      "access_limit": 100
    }
  • Response: Updated share link object

Usage Examples ​

Basic Usage ​

vue
<template>
  <AdvanceShareDialog
    :dialog="showAdvancedShare"
    :share-link="currentShareLink"
    :asset="selectedAsset"
    :workspace-id="workspaceId"
    @close="showAdvancedShare = false"
    @settings-saved="handleSettingsSaved"
  />
</template>

<script>
import AdvanceShareDialog from '~/components/dam/Dialogs/AdvanceShareDialog.vue'

export default {
  components: {
    AdvanceShareDialog
  }
}
</script>

Integration Points ​

  • Share Asset Dialog: Opens from share dialog
  • Share Management: Updates existing shares
  • Sharing Page: Share link management

Notes for Development ​

  • Password optional but validated if set
  • Expiration date must be in future
  • Download restrictions enforced
  • Domain restrictions validated
  • Access limits tracked