{{!--
  Create system user "wcmioDamSystemUser" and grant read/write/replicate access to everything below /content/dam.
--}}
{
  "jcr:primaryType": "rep:root",

  "content": {
    "jcr:primaryType": "sling:OrderedFolder",

    "dam": {
      "jcr:primaryType": "sling:OrderedFolder",

      "rep:policy": {
        "jcr:primaryType": "rep:ACL",
        "allow-wcmioDamSystemUser": {
          "jcr:primaryType": "rep:GrantACE",
          "rep:principalName": "wcmioDamSystemUser",
          "rep:privileges": [ "rep:write", "crx:replicate" ]
        }
      }

    }
  },

  "home": {
    "jcr:primaryType": "rep:AuthorizableFolder",

    "users": {
      "jcr:primaryType": "rep:AuthorizableFolder",

      "system": {
        "jcr:primaryType": "rep:AuthorizableFolder",

        "wcm-io-samples": {
          "jcr:primaryType": "rep:AuthorizableFolder",

          "wcmioDamSystemUser": {
            "jcr:primaryType": "rep:SystemUser",
            "jcr:uuid": "{{oakAuthorizableUuid "wcmioDamSystemUser"}}",
            "rep:authorizableId": "wcmioDamSystemUser",
            "rep:principalName": "wcmioDamSystemUser"
          }

        }

      }

    }

  }

}

{{!--
  Create system user "wcmioDamSystemUser" and grant read/write/replicate access to everything below /content/dam.
--}}
{
  "jcr:primaryType": "rep:root",

  "content": {
    "jcr:primaryType": "sling:OrderedFolder",

    "dam": {
      "jcr:primaryType": "sling:OrderedFolder",

      "rep:policy": {
        "jcr:primaryType": "rep:ACL",
        "allow-wcmioDamSystemUser": {
          "jcr:primaryType": "rep:GrantACE",
          "rep:principalName": "wcmioDamSystemUser",
          "rep:privileges": [ "jcr:read", "rep:write", "crx:replicate" ]
        }
      }

    }
  },

  "home": {
    "jcr:primaryType": "rep:AuthorizableFolder",

    "users": {
      "jcr:primaryType": "rep:AuthorizableFolder",

      "system": {
        "jcr:primaryType": "rep:AuthorizableFolder",

        "wcm-io-samples": {
          "jcr:primaryType": "rep:AuthorizableFolder",

          "wcmioDamSystemUser": {
            "jcr:primaryType": "rep:SystemUser",
            "jcr:uuid": "{{oakAuthorizableUuid "wcmioDamSystemUser"}}",
            "rep:authorizableId": "wcmioDamSystemUser",
            "rep:principalName": "wcmioDamSystemUser"
          }

        }

      }

    }

  }

}

Fix ACLs for DAM system user.
Fix ACLs for DAM system user.
