Sets the access list of a document or folder in the specified path.

Syntax

Visual Basic (declaration)
Public Function SetAccessList( _ 
ByVal AuthenticationTicket as String, _ ByVal Path as String, _ ByVal AccessListXML as String, _ ByVal ApplyToTree as bool) as XmlNode

C# (declaration)
public XmlNode SetAccessList( 
string AuthenticationTicket, string Path, string AccessListXML, bool ApplyToTree)

Parameters

AuthenticationTicket
    string infoRouter ticket
Path
    string The Path of a document or a folder that the accesslist to be applied.
AccessListXML
    string A xml fragment declares the accesslist. See the remarks section.
ApplyToTree
    bool If the path refers to a folder the access list can be apply to the sub folders and the documents in it.

Return Value

returns xml fragment.
<response success="true" error="">
if success attribute "true", the Access List has been Applied.
if success attribute "false", the error attribute returns the error description.

Remarks

The caller must be the system administrator or must have "Full Control" permissions on the Folder or the document.

The AccessList XML fragment should be structured as

<AccessList>
<DomainMembers Right="2"/>
<UserGroup Domain="" GroupName="Authors" Right="4"/>
<UserGroup Domain="" GroupName="Developers" Right="5"/>
<UserGroup Domain="ProjectX" GroupName="Architect" Right="6"/>
<User Domain="ProjectX" UserName="JoeD" Right="4"/>
<User Domain="ProjectX" UserName="JaneC" Right="6"/>
<User Domain="" UserName="SuzanP" Right="6"/>
</AccessList>

The Right Value can be

0 (No Access)
1 (List)
2 (Read)
3 (Add)
4 (Add & Read)
5 (Change)
6 (Full Control)

The 1 (List) and 3 (Add) right cannot be applied to the documents.

minus gif Example

Visual Basic Example
Sub SetAccessList()

        Const IRAuthenticationTicket As String = "sid-xxxxxxxxxxxxxxx"
        Const IR_Path As String = "/public"
 
        Dim xmlResponse As System.Xml.XmlElement
        Dim IR_Obj As InfoRouter.srv
        Dim xmldoc As System.Xml.XmlDocument
 
        Try
            xmldoc = New System.Xml.XmlDocument
            xmldoc.LoadXml("<AccessList/>")
 
            Dim xmlSecElem As System.Xml.XmlElement
 
            'Set DomainMembers Access
            xmlSecElem = xmldoc.CreateElement("DomainMembers")
            xmlSecElem.SetAttribute("Right", "4") 'Add and Read
            xmldoc.DocumentElement.AppendChild(xmlSecElem)
 
            'Set Change right to the usergroup (Authors@public) 
            xmlSecElem = xmldoc.CreateElement("UserGroup")
            xmlSecElem.SetAttribute("DomainName", "Public")
            xmlSecElem.SetAttribute("GroupName", "Authors")
            xmlSecElem.SetAttribute("Right", "5") 'Change
            xmldoc.DocumentElement.AppendChild(xmlSecElem)
 
            'Set Full Control Right to the User (JaneC)
            xmlSecElem = xmldoc.CreateElement("User")
            xmlSecElem.SetAttribute("DomainName", "")
            xmlSecElem.SetAttribute("UserName", "JaneC")
            xmlSecElem.SetAttribute("Right", "6") 'Full Control
            xmldoc.DocumentElement.AppendChild(xmlSecElem)
 
            IR_Obj = New InfoRouter.srv
            xmlResponse = IR_Obj.SetAccessList(IRAuthenticationTicket, _
                                               IR_Path, _
                                               xmldoc.DocumentElement.OuterXml, _
                                               False)
 
           If xmlResponse.GetAttribute("success") = "true" Then
                Console.WriteLine("The AccesList has been applied successfully.")
            Else
                Console.WriteLine("The AccesList cannot be applied:" & _
                                    xmlResponse.GetAttribute("error"))
            End If
 
        Catch ex As Exception
            Console.WriteLine("error:" & ex.Message)
 
        Finally
            xmlResponse = Nothing
            xmldoc = Nothing
            IR_Obj = Nothing
        End Try
 
End Sub