Restricting Database Access After Hours

This is a quick way to restrict access to a Notes database for those customers
who do not fully understand Notes security and want the database "shut down"
after hours. (My customer physically wanted the server to be shut down on a
nightly basis)

I created a scheduled agent that runs at 8:00 pm nightly to modify all entries
in the ACL except Managers and set their access to No Access. This restricts
all users while allowing you to still administer the server after hours. I
also wrote another scheduled agent to grant access that runs at 8:00 am.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim acl As NotesACL
Dim acl_entry As NotesACLEntry

On Error Goto ProcessError

Set nlog = New NotesLog("Restrict Access")
Call nlog.OpenAgentLog()
Call nlog.LogAction("Agent Started")

Set db = session.CurrentDatabase

If (db Is Nothing) Then
Call nlog.LogAction("db is nothing")
Exit Sub
End If

Set acl = db.ACL
Set acl_entry = acl.GetFirstEntry()

'ACL Level Access Key
'ACLLEVEL_NOACCESS = 0
'ACLLEVEL_DEPOSITOR = 1
'ACLLEVEL_READER = 2
'ACLLEVEL_AUTHOR = 3
'ACLLEVEL_EDITOR = 4
'ACLLEVEL_DESIGNER = 5
'ACLLEVEL_MANAGER = 6


While Not (acl_entry Is Nothing)
Select Case (acl_entry.Level)
Case ACLEVEL_DEPOSITOR:
Case ACLLEVEL_READER:
Case ACLLEVEL_AUTHOR :
Case ACLLEVEL_EDITOR :
Case ACLLEVEL_DESIGNER:
acl_entry.Level = ACL_NOACCESS
End Select
Set acl_entry = acl.GetNextEntry(acl_entry)
Wend

'save changes to the ACL
Call acl.Save
Call nlog.LogAction("agent completed successfully")
Call nlog.Close

Exit Sub

ProcessError:
Call nlog.LogError(Err,Error$ & " occured at line " & Erl)
Exit Sub

End Sub
This was first published in November 2000

Dig deeper on Lotus Notes Domino Administration Tools

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.uk

Close