I am trying to add a new Group to an existing Publication and assign Component Management permission as shown in the snippet below.

While using the below mentioned code I do not receive any error but the security Group is not added to the access control list of the Publication.

PublicationData oPublicationData = (PublicationData)client.Read(
                                                      publicationId, new ReadOptions());
PublicationData pubData = SetRightsOnPublication(oPublicationData, trustee, 
client.Update(pubData, new ReadOptions());

public static PublicationData SetRightsOnPublication(PublicationData oPublicationData, 
              TrusteeData trusteeId, Rights allowedRights, Rights deniedRights = Rights.None)
    var entries = oPublicationData.AccessControlList.AccessControlEntries.ToList();
    // First check if this trustee already has some permissions
    var entry = entries.SingleOrDefault(ace => ace.Trustee.IdRef == trusteeId.Id);
    if (entry != null)
        // Remove this entry

    entries.Add(new AccessControlEntryData
        AllowedRights = allowedRights,
        DeniedRights = deniedRights,
        Trustee = new LinkToTrusteeData { IdRef = trusteeId.Id, Title = trusteeId.Title, 
                                          Description = trusteeId.Description }});
    oPublicationData.AccessControlList.AccessControlEntries = entries.ToArray();
    return oPublicationData;
  • Did you try to debug and check ? Commented Nov 13, 2017 at 12:53
  • The logic looks very close to what I wrote in this blog post a while ago. blog.indivirtual.nl/… The only obvious difference is that I use Save instead of Update. That's probably better for a publication, because it's not versioned, but I don't expect that to be the problem. Maybe worth trying though. Commented Nov 13, 2017 at 18:59
  • @DominicCronin... thank you for your reply and i did take help from what you wrote in the blog... i also tried using client.save but , that also did not work for me . Do you think i am missing something else here ?
    – akhila
    Commented Nov 14, 2017 at 4:00

1 Answer 1


I have been struggling with a similar issue when setting permissions. The example from the link provided by Dominic led me in the right direction. I finally figured out when populating the new ArrayOfAccessControlEntryData object, new AccessControlEntryData objects have to be created. This is very strange, but if populated with the existing objects from the list, the changes were not saved into SDL. I assume the same issue could be true for setting rights on a publication.

See below for a working solution in a Java client:

    private void setOrganizationalItemPermissionsForTrustee(OrganizationalItemData organizationalItem, String trusteeId, String[] permissions) {
        // Create new access control entries array
        ArrayOfAccessControlEntryData accessControlEntries = new ArrayOfAccessControlEntryData();

        // Populate new access control entries array with access control entries we do not change
            .filter(p -> !p.getTrustee().getIdRef().equals(trusteeId))
            .forEach(p -> {
                // We have to create new AccessControlEntryData objects, otherwise changes are not saved :/
                AccessControlEntryData accessControlEntry = new AccessControlEntryData();

        // Create access control entry with new/updated permissions for provided trustee
        LinkToTrusteeData trustee = new LinkToTrusteeData();

        AccessControlEntryData updatedAccessControlEntry = new AccessControlEntryData();


        // Set newly created access control entries array on organizational item


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.