2

i'm trying to set the permissions over a publication with C#, but with the core service API i've no access to:

  • Customer Management
  • Segment Management
  • Mailing Management
  • Outbound Email Management
  • User Genereted Content
  • Publish to Content Distributor
  • Mailing Execution
  • Contact Management
  • Distribution List Management.

Is there any way to set that Rights?

We are using now this way to set:

SetRightsOnPublication(newPub, "tcm:0-" + gContribucion + "-65568", Rights.Anythig);
                    _Client.Save(newPub, new ReadOptions());
1
  • 2
    I've got no example handy, but the short answer is yes. SDL uses the public APIs to manage anything you can set in the UI, so if the UI can do it, you can do it too.
    – Nuno Linhares
    Nov 29, 2016 at 9:26

1 Answer 1

2

The way you are setting the rights to groups for a certain publication is ok.

You can use the Rights Enumeration to select the desired right to set, but from the list you are questioning there are some points to clarify:

  • The Publish to Content Distributor right is the same as Rights.PublishManagement in the Enumeration.
  • The User Generated Content right is set and stored by means of the "AppData".
  • The other ones of the list, that are part of the Audience Manager & Outbound Email extension, are set in his own database, as @PeterKjaer comments.

If you need to stablish rights & permission for this applications, the ApplicationData Object of the Core Service must be used, and it depends on the proper application wich defines the objects that can be set.

In the case of User Generated Content security settings, we can take the code where the Publication Rights are set in the CME; we can use something similar to this:

public static void SetPublicationRightsAppData(SessionAwareCoreServiceClient coreClient, string publicationId, string appDataString = "<ugc><trustees></trustees></ugc>")
{
  ApplicationData applicationData = new ApplicationData()
  {
    ApplicationId = "ugc:PublicationRights",
    TypeId = "c:XmlDocument-CommunityBuilder",
    Data = Encoding.Unicode.GetBytes(appDataString)
  };
  coreClient.SaveApplicationData(publicationId, new ApplicationData[1]
  {
    applicationData
  });
}

Hope this helps

2
  • Yes, i need at least one example of ApplicationData usage for this case. Nov 29, 2016 at 16:06
  • 1
    A small correction: AM/OE stores rights in its own database, not in AppData. There is no way to set them through the Core Service. Nov 30, 2016 at 11:10

Your Answer

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

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