Removing Enforce Consistent ACL

Removing Enforce Consistent ACL

Messagepar Michael DELIQUE » 02 Jan 2008 à 15:25

Code : Tout sélectionner
Function RemovingEnforceConsistentACL_API(wDb As NotesDatabase) As Integer
   
%REM
'Variables API pour la fonction RemovingEnforceConsistentACL_API
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
%END REM
   
   'Déclaration Variables   
   
   Dim nbReturnValue As Long
   Dim nbHDB As Long
   Dim nbHACL As Long
   Dim nbFlag As Long
   Const ACL_UNIFORM_ACCESS = 1
   
   If wDB Is Nothing Then
      RemovingEnforceConsistentACL_API = False
      Exit Function
   End If
   
   nbReturnValue = NSFDbOpen(wDB.FilePath, nbHDB)
   nbReturnValue = NSFDbReadACL(nbHDB, nbHACL)
   nbReturnValue = ACLGetFlags(nbHACL, nbFlag)
   If nbFlag And ACL_UNIFORM_ACCESS Then
      nbFlag = nbFlag Xor ACL_UNIFORM_ACCESS
      nbReturnValue = ACLSetFlags(nbHACL, nbFlag)
      nbReturnValue = NSFDbStoreACL(nbHDB, nbHACL, 0, 0)
      RemovingEnforceConsistentACL_API = True
   Else
      RemovingEnforceConsistentACL_API = False
   End If
   nbReturnValue = NSFDbClose(nbHDB)
   
   Exit Function
ErreurHandle:
   Msgbox "("+Cstr(Getthreadinfo (1))+" Call by "+Cstr(Getthreadinfo(10))+")"+Chr(10)+"Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"
   RemovingEnforceConsistentACL_API = False
   Exit Function
End Function
Cordialement

Michael (SMS-Phobique)
----------------------------
"La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi."
Albert EINSTEIN
Avatar de l’utilisateur
Michael DELIQUE
Administrateur
Administrateur
 
Message(s) : 12183
Inscrit(e) le : 16 Déc 2004 à 10:36
Localisation : Paris/Cergy

Retour vers API