Synchronization Permissions

Synchronization permissions determine if a principal has the permissions required to synchronize a catalog version or CMS items within a catalog version.

Backend Implementation

canSynchronize Method

SmartEdit uses the canSynchronize method of the CatalogSynchronizationService to determine if a principal has the synchronization permissions required to synchronize a selected catalog version or CMS item. A principal has synchronization permission when the following conditions are met:

  • When the syncPrincipalsOnly flag is set to true and the principal is part of the sync job's syncPrincipals.
  • When the syncPrincipalsOnly flag is set to false and the principal has write permission to the target catalog version.

Catalog Synchronization Validator

The CatalogSynchronizationValidator validates the synchronization permissions for a principal before starting the synchronization process between two catalog versions. The cmsfacades-spring.xml file contains the configuration for the validator. The following diagram shows how the CatalogSynchronizationValidator is used in the SynchronizationFacade:

The validator can generate the following errors:

  • Unauthorized synchronization. Reason: The principal doesn't have permissions to synchronize.
  • No sync configuration found for catalog.

The No sync configuration found for catalog error is generated if no synchronization configuration is found to synchronize from the source and to the target catalogs.

The CatalogSynchronizationValidator is also used to validate that a principal has the synchronization permission required to synchronize a CMS item. The following diagram shows how the validator is used in the ItemSynchronizationFacade:

Permission API

SmartEdit makes a request to the Permission API to retrieve synchronization permissions.

catalogVersionPermissionService

The catalogVersionPermissionService provides the following methods to support the synchronization permissions:

  • hasSyncPermission: Verifies that the principal has the required synchronization permissions for the catalog, and the source and target catalog versions.
  • hasSyncPermissionFromCurrentToActiveCatalogVersion: Verifies that the principal has the required synchronization permissions for the current catalog version.
  • hasSyncPermissionToActiveCatalogVersion: Verifies if the principal has the required synchronization permissions for the catalog and catalog version.

Frontend Implementation

A user's synchronization permissions influence what SmartEdit displays in its interface. If a user has synchronization permissions, SmartEdit displays a Sync button in the following locations:

  • Landing page
  • Pages view
  • Trash view
  • Storefront pages
  • Content slots

Configuring Permissions

Synchronization permissions determine if the principal has access to synchronize a specific catalog version or not. You can configure the synchronization permissions in the Backoffice Administration Cockpit or by impex.

Configuring Synchronization Permissions in the Backoffice Administration Cockpit

  1. Log into the Backoffice as the admin user.

  2. Go to Start of the navigation pathSystem Next navigation step Multithreaded SynchronizationEnd of the navigation path in the navigation tree.

  3. Select the synchronization job that you want to configure permissions for.

  4. In the synchronization job area, select the Administration tab.

  5. Add the user to the Sync Users list.

  6. Save your changes.

Configuring Synchronization Permissions by ImpEx

  1. Set up a file to import the synchronization permissions for your users and user groups as shown in the following file example:

    $contentCatalog=electronicsContentCatalog
    $syncJob=sync $contentCatalog:Staged->Online
    
    
    INSERT_UPDATE CatalogVersionSyncJob; code[unique=true]; syncPrincipals(uid)[mode=append]; syncPrincipalsOnly;
    ;$syncJob;cmsmanagergroup;true
  2. Import the impex file into your SAP Commerce Cloud.