Take a survey

Developing Applications Using APIs > Working with LiveCycle ES Repository > Controlling Access to Resources > Configuring access control lists using the web service API

Configuring access control lists using the web service API
To programmatically configure access control lists using the Repository service web service API, perform the following tasks:
1.
2.
Using the Microsoft .NET client assembly, create a RepositoryServiceService object by invoking its default constructor. Set its Credentials property using a System.Net.NetworkCredential object containing the user name and password.
3.
Specify a string containing the URI of the resource. In this case, because the resource is the folder testFolder, its URI is "/testFolder". When using a language compliant with the Microsoft .NET Framework (for example, C#), store the URI in a System.String object.
4.
Invoke the RepositoryServiceService object’s readAccessControlList method and pass the URI of the resource as a parameter. The method returns an AccessControlList object. Pass null for the second parameter.
5.
Retrieve the AccessControlList object’s usersWithPermissions field, which is an object array containing strings representing the user identifiers. In this example, the list of users is printed to the screen.
6.
Invoke the default constructor for the AccessControlList class to create a new AccessControlList object to be used.
7.
Determine which user identifiers to be used in the access control list. In this example, the first user in the list previously retrieved will be used.
8.
Create an object array that will be used to store the list of permissions, and add the preferred permissions to the array, which must be specified as strings. In this example, traversal and read permissions are specified for a folder; therefore, the values "Traverse" and "Read" are added to the list.
Invoke the default constructor for the AccessControlEntry class to create a new object needed for storing the permissions, and assign the permissions object to the AccessControlEntry object’s permissions field.
Create an object array, store the AccessControlEntry object in it, and assign the array to the AccessControlList object’s entries field.
Create an object array, store the user identifier in it, and assign the array to the AccessControlList object’s usersWithPermissions field.
9.
Invoke the RepositoryServiceService object’s writeAccessControlList method and pass in the following parameters:
A boolean value used to determine whether to propagate the permissions to all path-contained resources if the resource is a collection (com.adobe.repository.infomodel.bean.ResourceCollection). In this example, the value true is specified.
A boolean value used to determine whether the propagate value was specified. In this example, a value of true is specified.
Pass null for the remaining parameter.
View Quick Start
 

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/sdkHelp/repositoryAccessingFiles.127.4.html