Removing an Entry in the ACL with script

I have a name in a field called dg_Remove, and I’m trying to remove the person’s name that is in this field from the acl. Here is the code I have so far:

Dim Workspace As New NotesUIWorkspace

Set uidoc = Workspace.currentdocument

Dim curDoc As NotesDocument

Set curDoc = uidoc.document

Dim entry As NotesACLEntry

Set entry = acl.GetEntry( curdoc.dg_Remove(0) )

Call entry.Remove

Call acl.Save

When I do this, the entry variable never sets, although the name in dg_Remove is there (and visible in the debugger.) I’m not sure how I trick it into seeing the value in dg_Remove as an ACL Entry.

Thanks for any help on this one.

-Justin

Subject: Removing an Entry in the ACL with script

You are not setting the ACL object before using acl.GetEntry

dim s as New notesSession

dim db as NotesDatabase

dim acl as NotesACL

Set acl = db.ACL

then

Set entry = acl.GetEntry( curdoc.dg_Remove(0) )

Subject: RE: Removing an Entry in the ACL with script

Thanks for responding Narasimhan, I am setting the ACL object, I just forgot to copy that line from my code into my post.

Sorry, and thanks.

Subject: RE: Removing an Entry in the ACL with script

Ok. Then why don;t you try trimming the value as:

Set entry = acl.GetEntry(trim$(curdoc.dg_Remove(0)))

and make sure the field contains the same value as in ACL(Abbreviated or…).

Subject: RE: Removing an Entry in the ACL with script

I’ll try that.

Thanks for your time.

-Justin

Subject: *

Subject: Removing an Entry in the ACL with script

When you step through this in the debugger is the entry properly set? The code basically looks OK to me. Working with the ACL in LS does have some problems.

We have developed Workflo!ACL Manager that basically allows you to modify the ACL of one or more selected ND Databases without having to open each individulally. For example you want to remove all occurances of a persons name from all databases on the server. Or add an Admin group to every DB in the Mail forlder. It also allows you to select a person or group and find out what rights they have to any/all databases.

Pretty neat tool that can save a lot of time and effort and reinventing the wheel. So for very little money you can save yourself a lot of time. Download a demo from our site at:

http://wfs.com/workweb/wfsweblib.nsf/Src/DocSet*Notes+Net07

Subject: RE: Removing an Entry in the ACL with script

Looks like a cool tool, Bill. I’ll look into that for future administrative needs. Meanwhile, I need this code to work like yesterday (typical fashion). When I step thru the code, entry gets dimmed as a NotesACLEntry, but it’s blank. It should have been set by seeing the value in the dg_Remove field, but it just doesn’t see it, or resolve it.

Thanks,

Justin