ACL Group Changes

good afternoon. i am trying to build a script that will loop thru an acl and find all the groups that contain an “" as the first character and then i would like to copy the complete acl entry and just replace the "” with an “&”. i can’t figure out how to copy it completely as far as access and roles go. is there a method to do this?

thanks,

jason

Subject: ACL Group Changes

I don’t know if this is 100 percent error free but you might want to try this code:

Dim s As New NotesSession

Dim db as Notes Database

Dim acl As NotesACL

Dim e As NotesACLEntry

Dim firstPosStr as String

set db = s.current database

Set acl = db.ACL

Set e = acl.GetFirstEntry

Do Until e Is Nothing

furstPosStr = Left(e.Name,1)

If firstPosStr = “*” then then

'remove and replace * with &

Dim eLen as Integer

eLen = Len(e.name)

newName$ = Right(e.Name,eLen-1)

newName$ = “&” + newNameStr

'set new ACL entry with new name

Dim newAclName as New NotesACLEntry(acl,newName$,e.Level) 'this will put the

'newACLName in the existing ACL

newAclName.UserType = e.UserType

'now set the acl rights

newAclName. CanCreateDocuments = e.CanCreateDocuments

newAclName.CanDeleteDocuments= e.CanDeleteDocuments

newAclName.CanCreateLSOrJavaAgent= e.CanCreateLSOrJavaAgent

newAclName.CanCreatePersonalAgent = e.CanCreatePersonalAgent

newAclName.CanCreatePersonalFolder= e.CanCreatePersonalFolder

newAclName.CanReplicateOrCopyDocuments= e.CanReplicateOrCopyDocuments

newAclName.IsPublicWriter= e.IsPublicWriter

newAclName.IsPublicReader = e.IsPublicReader

'set the acl Roles

ForAll r in e.Roles

newAclName.IsRoleEnabled(r)=True

End If

Call acl.Save

Set e = acl.GetNextEntry(e)

Loop

Subject: ACL Group Changes

What I understood from your requirement can be done. Check NotesACL and NotesACLEntry classes in Designer Help. It a bit long code, but achievable.

You just need to get acl entries (GetFirstEntry - GetNextEntry), check if its a Group (IsGroup Or UserType),if yes, does it have * as first Char (Left), if yes, what are its privilages (CanCreateDocuments etc …), what are roles (Roles property of Notes ACL Entry class) assigned.

Remove * with &, Then create entry in ACL (CreateACLEntry), with new Name, set its type as previous usertype, asigned it same roles and privilages.

Hope this helps.