RDOACL object

 

RDOACL object represents the Access Control List (ACL) of an Exchange folder. This object along with the RDOACE object (representing an ACL entry) allows to define the list of Exchange users who have access to a given folder.

 

Returned by:

RDOFolder.ACL

 

The example below logs to the default MAPI session and adds an Exchange user to a list of users who have access to the Calendar folder. The user is given the editor rights.

set Session = CreateObject("Redemption.RDOSession")
Session.Logon
set Folder = Session.GetDefaultFolder(olFolderCalendar)

'make sure we get back an Exchange user
set AddressEntry = Session.AddressBook.GAL.ResolveName("natalia")
set ACE = Folder.ACL.Add(AddressEntry)
ACE.Rights = ROLE_PUBLISH_EDITOR

 

The following example logs to the default MAPI session and enumerates all users who have access to the Calendar folder along with their rights

set Session = CreateObject("Redemption.RDOSession")
Session.Logon
set Folder = Session.GetDefaultFolder(olFolderCalendar)

for each ACE in Folder.ACL
  Debug.Print ACE.Name & " - " & ACE.Rights
next

 


Derived from: IDispatch



Properties


BatchMode Boolean, read/write.
ACL is saved automatically when an ACE (RDOACE object) is modified. Modifying a large number of ACEs in a folder thus represented a major performance problem. When BatchMode property is set to true, ACL will be saved only when RDOACL.Save method is called.
See Save method below.
ROLE_PUBLISH_EDITOR = &H4FB
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Folder = Session.GetFolderFromID(Application.ActiveExplorer.CurrentFolder.EntryID)
set ACL = Folder.ACL
ACL.BatchMode = true
'select new members and add them
set ABDialog = Session.GetSelectNamesDialog
ABDialog.AllowMultipleSelection = true
ABDialog.ToLabel = "Members"
ABDialog.InitialAddressList = Session.AddressBook.GAL
ABDialog.ForceResolution = true
ABDialog.NumberOfRecipientSelectors = 1
ABDialog.ShowOnlyInitialAddressList = true
'make sure the existing members are shown by the address book
for each ACE in ACL
   
if (not ACE.IsDefault) and (not ACE.IsAnonymous) Then
        'otherwise there is no corresponding address entry

        ABDialog.Recipients.Add(ACE.AddressEntry)
   
End If
next
'display the address book
if ABDialog.Display Then
    'add each selected member as a publishing editor
   
for each recip in ABDialog.Recipients
       
set ACE = ACL.Add(recip.AddressEntry)
       
ACE.Rights = ROLE_PUBLISH_EDITOR
   
next
   
'all done, save
   
ACL.Save
End If

Count

integer, read-only. Returns the number of folders in the list

set Session = CreateObject("Redemption.RDOSession")
Session.Logon
set Folder = Session.GetFolderFromID(MAPIFolder.EntryID)

for i = 1 to Folder.ACL.Count
  set ACE = Folder.ACL.Item(i)
  Debug.Print ACE.Name & " - " & ACE.Rights
next

_Item(Index)

returns RDOACE object with a given index. Default object property.

Index - integer, 1 through Count.

see the example above

Folder

Returns the parent folder (RDOFolder object)

 

RawTable

IUnknown, read-only. Returns the IMAPITable Extended MAPI interface used internally by the RDOACL collection

 

Session

RDOSession, read-only. Returns the parent MAPI session represented by the RDOSession object

 

MAPITable

MAPITable, read-only. Returns the MAPITable Redemption object which can be used to manipulate the collection (restrict, find, etc).

 


Methods


Add(AddressEntryObjOrEntryID)

Adds an Exchange user to the folder ACL list. Returns the RDOACE object.

AddressEntryObjOrEntryID - variant. Either an RDOAddressEntry object or a (hex) string representing an Exchange user's entry id.

set Session = CreateObject("Redemption.RDOSession")
Session.Logon
set Folder = Session.GetDefaultFolder(olFolderCalendar)

'make sure we get back an Exchange user
set AddressEntry = Session.AddressBook.GAL.ResolveName("natalia")
set ACE = Folder.ACL.Add(AddressEntry)
ACE.Rights = ROLE_PUBLISH_EDITOR

 

Item(Index)

returns RDOACE object with a given index.

Index - integer, 1 through Count.

 

Remove(Index)

Removes an ACL entry with a given index.

Index - integer, 1 through Count.

 

Save
Saves the ACL.
Applicable only when BatchMode property is set to true.
See BatchMode example above

ACEofAddressEntry(AddressEntryObjOrEntryID)

Returns an RDOACE object corresponding to a given Exchange user. If the user is not in the ACL list, NULL is returned.

AddressEntryObjOrEntryID - variant. Either an RDOAddressEntry object or a (hex) string representing an Exchange user's entry id.

'check if a given Exchange user is in the ACL list

'and remove it

set Session = CreateObject("Redemption.RDOSession")
Session.Logon
set Folder = Session.GetDefaultFolder(olFolderCalendar)
set AddressEntry = Session.AddressBook.GAL.ResolveName("natalia")
set ACE = Folder.ACL.ACEofAddressEntry(AddressEntry)
if not (ACE is Nothing) Then
  ACE.Delete
  'or one can set the ACE.Rights property to RIGHTS_NONE (0)
End If