Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Public Folder Permissions through CDO

Status
Not open for further replies.

topry

Programmer
Aug 18, 2001
13
0
0
US
I am using CDO to delete / recreate a public folder each evening with contact records. When the folder is created, Default permissions are set to Author and we need them to be Editor. I have not been able to find any documentation on changing the folder permissions programmatically through CDO or any other API.

Does anyone know if there is an API / CDO function to accomplish this?
 
Found the answer to my own question - so this is for anyone else that may be trying to do this.

Public Folder rights can be set through the ACL COM object available from MS (MSDN site) or SlipStick. While I have yet to find any good VB examples of utilizing the ACL object (other than a small app on Slipstick to read properties, nothing to change / add items) - there are several VBScript.

Following is a simple example of changing rights for an existing ACL member. If anyone should know of a good set of routines in VB6 for using the ACL object, please post a link.


Public Function SetFolderPermissions(oFldr As folder, ByVal iMember As Integer, ByVal lRights As Long) As Boolean
Dim oACL As ACLObject
Dim oACE As ace
Dim icntr As Integer

Set oACL = New ACLObject
Set oACE = New ace
'set the ACL to the that of the passed folder
Set oACL.CDOItem = oFldr ' passed Folder object

'create an iACEs object (so we can set the ACE based upon the index value passed)
Dim oiACEs As iACEs
Set oiACEs = oACL.aces

'set our ACE object to the one requested - if invalid, it will throw an error
Set oACE = oiACEs(iMember)

'set the rights to what was passed
oACE.Rights = lRights
'update the ACL
oACL.Update

End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top