home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 27 / IOPROG_27.ISO / SOFT / ADSDK.ZIP / ResourceKit / ADsSecurity / File / File.bas next >
Encoding:
BASIC Source File  |  1999-02-15  |  744 b   |  34 lines

  1. Attribute VB_Name = "Module1"
  2. Sub Main()
  3. Dim sec As New ADsSecurity
  4. Dim sd As IADsSecurityDescriptor
  5. Dim dacl As IADsAccessControlList
  6. Dim ace As IADsAccessControlEntry
  7. Dim newAce As New AccessControlEntry
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14. Set sd = sec.GetSecurityDescriptor("FILE://\\srv01\public")
  15. Set dacl = sd.DiscretionaryAcl
  16.  
  17. '-- Show the ACEs in the DACL ----
  18. For Each ace In dacl
  19.   Debug.Print ace.Trustee
  20.   Debug.Print ace.AccessMask
  21.   Debug.Print ace.AceType
  22. Next
  23. Debug.Print dacl.AceCount
  24.  
  25. newAce.Trustee = "ARCADIABAY\jsmith"
  26. newAce.AccessMask = ADS_RIGHT_GENERIC_READ Or ADS_RIGHT_GENERIC_EXECUTE
  27. newAce.AceType = ADS_ACETYPE_ACCESS_ALLOWED
  28.  
  29. dacl.AddAce newAce
  30. sd.DiscretionaryAcl = dacl
  31. sec.SetSecurityDescriptor sd
  32.  
  33. End Sub
  34.