How to access a locked down Notes database and one more thing

I don’t do much Notes development these days but every now and then it happens. The last few days I’ve been spending some time with Notes doing a few modifications to a client’s system and came across these two problems:

The client emailed me two Notes database but forgot to uncheck “Enforce a consistent Access Control List”.

Back in the good old days, I’m talking Notes R4 and earlier, you used to have full access to any database that you accessed locally, i.e. a database that was stored or replicated to your local machine. I don’t know what the design reasons for this might have been, but one major drawback of course was that you couldn’t restrict what a user could and could not do as efficiently on a local replica as you could if the application resided on a server. Also Roles did not work locally. Anyway, this all changed in some R4 sub release when the Enforce a consistent ACL was introduced. But now you’ve got a problem whenever you as a developer need access to a database and you’re not in the ACL.

So usually there are two ways around this:
– If there is a manager group in the ACL, create this group in your local address book and add yourself.
– Ask the client to send you a new copy of the database where Enforce a consistent ACL is unchecked.

Today neither of these were an option and I was on a deadline so I Googled to see if there was a solution somewhere. At Ben Poole’s blog I found a third solution. Ben has written some code that uses the Notes API to uncheck Enforce a consistent ACL for you on a local database, no matter what your access rights are.
Simply download the code from Ben’s blog and copy and paste it to a button on a Notes form. Then call the removeEnforce function with the full path and filename of the database as argument.
For me the checkbox got unchecked but for some reason I still didn’t have full access to the ACL so I had to restart Notes and then it worked fine. According to Ben this script should do the trick for both Notes R5 and R6. Myself I used it in R7.

Ok, so with that done time for next problem: I was simply changing what default view should be opened to the user in a frameset (Notes client, no web). The old view worked fine but when I changed to the new one I got one of Notes many informative error messages: “Cannot execute the specified command.”
After doing some troubleshooting I found out that the problem was that I did a @Command([ViewCollapseAll]) in the views PostOpen event. So I searched Notes.net/LDD/Developerworks (I don’t even know what they call it anymore) and I found this thread that didn’t explain why but at least provided a work around. Adding @Command([OpenView];@ThisName) worked for me in Notes 7.0

@Command([OpenView]; @ThisName );
@Command([ViewCollapseAll])

@ThisName is new in R7 R6 [corrected] so to get this to work in previous versions you need to provide the view name as a common string (see the Notes.net thread).

3 comments

  1. Actually, @ThisName was new to ND6.x, so you should be able to use that trick there too.

    Glad to hear that the Enforce ACL code works in 7 as well — I don’t have it, so couldn’t test.

    With regards the re-start you had to do, I suspect that this is due to the fact that the Notes client caches your access privileges to databases during a session.

    In addition to a restart of the client, you should find that pressing F5 & logging in again will do the trick, as F5 clears all user credentials.

  2. Hi Ben,

    You’re right about @ThisName of course, updated the main post.

    I did try F5 but strangely that did not do the trick, I had to restart Notes.

  3. Hello.
    Is there a way to get this working for an ecrypted database. My email database has the local security on and it is encypted and my ID is no longer valid. Is there any hope that I can remove the local security?

Leave a Reply to Anonymous Cancel reply

Your email address will not be published. Required fields are marked *