'RemoveEnfC_ACL: 

Option Declare

Declare Function NSFDbOpen Lib "nnotes.dll" (Byval pathName As String, hDB As Long) As Integer
Declare Function NSFDbReadACL Lib "nnotes.dll" (Byval hDB As Long, hACL As Long) As Integer
Declare Function ACLGetFlags Lib "nnotes.dll" (Byval hACL As Long, dwFlags As Long) As Integer
Declare Function ACLSetFlags Lib "nnotes.dll" (Byval hACL As Long, dwFlags As Long) As Integer
Declare Function NSFDbStoreACL Lib "nnotes.dll" (Byval hDB As Long, Byval hACL As Long, objectID As Long, method As Long) As Integer
Declare Function NSFDbClose Lib "nnotes.dll" (Byval hDB As Long) As Integer

Const ACL_UNIFORM_ACCESS = 1 
Sub Initialize
	Const msg = "Enter the path to the local database:"
	Dim choice As String
	Dim db As NotesDatabase
	Dim filePath As String
	Dim result As Integer
	Dim hDB As Long
	Dim hACL As Long
	Dim flags As Long 
	
	Dim ws As New NotesUIWorkspace
	Dim session As New NotesSession
	
	choice = session.GetEnvironmentString("Directory", True) & "\"
	choice = ws.Prompt(3, "Enter Path", msg, choice, "")
	If choice = "" Then Exit Sub
	If Instr(choice, session.GetEnvironmentString("Directory", True)) <> 0 Then
		choice = Strright(choice, session.GetEnvironmentString("Directory", True))
	End If
	While Left(choice, 1) = "\"
		choice = Mid(choice, 2)
	Wend 
	result = NSFDbOpen(filePath, hDB)
	result = NSFDbReadACL(hDB, hACL)
	result = ACLGetFlags(hACL, flags)
	If flags And ACL_UNIFORM_ACCESS Then
		flags = flags Xor ACL_UNIFORM_ACCESS
		result = ACLSetFlags(hACL, flags)
		result = NSFDbStoreACL(hDB, hACL, 0, 0)
	Else
		Print "The flag is not set. Nothing changed."
	End If
	result = NSFDbClose(hDB) 
End Sub

