Administering an Encyclopedia volume : About Encyclopedia-level management operations : Updating a file or folder : Updating the privilege settings of a file or folder
 
Updating the privilege settings of a file or folder
Using UpdateFile, you can apply the ACL of a folder to files and folders within it. Depending on the suboperation you use, you can either replace an object’s ACL with those of the folder that contains it or add a folder’s privileges to those of an object in the folder.
For example, the ACL of the Marketing folder grants the Buyer security role visible privileges to Marketing. The ACL of a subdirectory within the Marketing folder grants the Buyer security role read and write privileges. Adding the ACLs of Marketing and the subdirectory within Marketing gives the Buyer security role visible, read, and write privileges to the subdirectory. On the other hand, if you replace the ACL of the subdirectory, the Buyer security role has only visible privileges to the subdirectory.
Whether you add or replace an ACL, you can choose to make the results of the operation recursive. Using the recursive option, you can apply the results to all files and folders in the working folder, including all files and folders in a subdirectory.
Replacing an object’s ACL with that of the folder that contains it
To replace the privileges of a file or folder with those of the folder that contains it, use the SetPermissions suboperation of UpdateFile, as shown in the following example. In this example, the AccessRight element for each security role or user defines the security role or user’s privileges to the working folder. Use an empty Search element to replace the ACL of all files and folders in the working folder. The omission of the Recursive element indicates that the operation affects only the immediate descendants of the working folder.
<SOAP-ENV:Body>
<Administrate>
<AdminOperation>
<UpdateFile>
<WorkingFolderId>170</WorkingFolderId>
<UpdateFileOperationGroup>
<UpdateFileOperation>
<SetPermissions>
<Permission>
<RoleName>Regional Managers</RoleName>
<AccessRight>S</AccessRight>
</Permission>
<Permission>
<RoleName>Operator</RoleName>
<AccessRight>VSREWDG</AccessRight>
</Permission>
<Permission>
<RoleName>Active Portal Administrator
</RoleName>
<AccessRight>VSREWDG</AccessRight>
</Permission>
</SetPermissions>
</UpdateFileOperation>
</UpdateFileOperationGroup>
<Search/>
</UpdateFile>
</AdminOperation>
</Administrate>
</SOAP-ENV:Body>
Adding the ACL of a folder to an object in the folder
To add the ACL of a folder to that of an object in the folder, use the GrantPermissions suboperation of UpdateFile. In the following example, access rights to the working folder for two security roles and a user appear in the AccessRight element. The result of this operation is that these security roles and this user receive the same rights to files in the working folder.
<SOAP-ENV:Body>
<Administrate>
<AdminOperation>
<UpdateFile>
<WorkingFolderName>/Sales/Eastern Region
</WorkingFolderName>
<UpdateFileOperationGroup>
<UpdateFileOperation>
<GrantPermissions>
<Permission>
<RoleName>Sales</RoleName>
<AccessRight>SVE</AccessRight>
</Permission>
<Permission>
<RoleName>Eastern Sales Managers
</RoleName>
<AccessRight>VSREWDG</AccessRight>
</Permission>
<Permission>
<UserName>Kevan Blaine</UserName>
<AccessRight>VSREWDG</AccessRight>
</Permission>
</GrantPermissions>
</UpdateFileOperation>
</UpdateFileOperationGroup>
<Search/>
</UpdateFile>
</AdminOperation>
</Administrate>
</SOAP-ENV:Body>
Use an empty Search element to update the ACL of all files and folders in the working folder. The omission of the Recursive element indicates that this operation affects only the immediate descendants of the working folder.
Adding privileges recursively
To add privileges from a directory to all files and folders within it, including subfolders and their contents, set the Recursive element to True.
<UpdateFile>
<WorkingFolderName>/Sales/Eastern Region</WorkingFolderName>
<Recursive>True</Recursive>
</UpdateFile>