1

My pipeline is failing when adding ViewAllData to a permission set, the following error is shown:

Permission ViewAllData depends on permission(s): ViewDataLeakageEvents, ViewPlatformEvents

The pipeline attempts to deploy our changes to a new scratch org with our existing metadata. You can see in my definition file below we enable both streaming events and forensics which I believe are related to the permissions required above.

This is my scratch org definition:

{
  "orgName": "Scratch Org",
  "edition": "Developer",
  "features": [
    "API",
    "AuthorApex",
    "EnableSetPasswordInApi",
    "PersonAccounts",
    "ContactsToMultipleAccounts",
    "DevelopmentWave",
    "SharedActivities"
  ],
  "settings": {
    "lightningExperienceSettings": {
      "enableS1DesktopEnabled": true
    },
    "mobileSettings": {
      "enableS1EncryptedStoragePref2": false
    },
    "accountSettings": {
      "enableAccountTeams": true,
      "enableRelateContactToMultipleAccounts": true
    },
    "opportunitySettings": {
      "enableOpportunityTeam": true
    },
    "quoteSettings": {
      "enableQuote": true
    },
    "pathAssistantSettings": {
      "pathAssistantEnabled": true
    }, 
    "currencySettings":{ 
      "enableMultiCurrency": true 
    },
    "enhancedNotesSettings":{
      "enableEnhancedNotes": true,
      "enableTasksOnEnhancedNotes": true 
    },
    "dynamicFormsSettings":{
      "enableFormsOnMobile": true
    },
    "nameSettings":{
      "enableMiddleName": true,
      "enableNameSuffix": true
    },
    "eventSettings": {
      "enableEventLogGeneration": true,
      "enableTransactionSecurityPolicies": true,
      "enableDeleteMonitoringData": true,
      "enableLoginForensics": true,
      "enableStreamingApi": true,
      "enableDynamicStreamingChannel": false,
      "bypassMeteringBlock" :false
    }
  }
}
3

2 Answers 2

0

You can try the workaround provided into the known issue:

Now add the ModifyAllData user permission (to be enabled, true) in the XML file and deploy the metadata or Manually aggregate the Source and Target objectPermissions to have no object missing before the deployment.

0

You need to add the following to the *.permissionset-meta.xml files that the deploy step is listing as having failed.

<userPermissions>
    <enabled>true</enabled>
    <name>ViewDataLeakageEvents</name>
</userPermissions>
<userPermissions>
    <enabled>true</enabled>
    <name>ViewPlatformEvents</name>
</userPermissions>

Add this above where you see the ViewAllData setting

<userPermissions>
    <enabled>true</enabled>
    <name>ViewAllData</name>
</userPermissions>
2
  • This fails, it returns a Unknown user permission: ViewDataLeakageEvents error. Commented Oct 15 at 15:49
  • Yes, I've found the same. This works on a scratch org but not when attempting to deploy to sandbox.
    – Melissa
    Commented Oct 16 at 3:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .