SetPermissionsRequest

Defines the permissions for a particular user for a specified repository node or resource. When you set permissions, the basic read permissions are always kept for the user, however any additional permissions that were previously set or added are removed. For example if you set the modify permission for a user who currently had the all permission, that user will now have only read and modify permissions, and no longer have the all permission.

Parameters

The following parameters are used:

Parameter Example Description
action SetPermissionsRequest

Specifies the method name to set permissions for a user.

UserName user1

Specifies the user to set permissions.

ResourcePath /Samples/NamedTables/

Specifies the specific repository node (directory) or resource to set the permissions. The resources specified in resourcePath are listed from the top level of the repository http://<server>:<port>/RepositoryService/repository/default/.

Permissions add

Specifies the permissions. There are five valid permission types: read, all, add, modify, and remove.

Recursive false

Specifies if this operation should be performed recursively on all child nodes of the given node in the repository. The default for recursive permission setting is false. If setting permissions on individual resources in the repository, the Recursive option will have no effect.

Example

The following example sets the permissions for user1 on the NamedTables node (and all child nodes) to add and modify. After performing this operation the user1 will have read, add, and modify permissions on the NamedTables node and all of the child nodes.


<?xml version="1.0"?>  
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:v1="http://www.mapinfo.com/midev/service/usermanagement/v1">  
   <soapenv:Header/>  
   <soapenv:Body>  
      <v1:SetPermissionsRequest>  
         <v1:UserName>user1</v1:UserName>  
         <v1:ResourcePath>/Samples/NamedTables/</v1:ResourcePath>  
         <v1:Permissions>  
            <v1:Permission>add</v1:Permission>  
            <v1:Permission>modify</v1:Permission>  
         </v1:Permissions>  
         <v1:Recursive>true</v1:Recursive>  
      </v1:SetPermissionsRequest>  
   </soapenv:Body>  
</soapenv:Envelope>