Aces Collection

The ACEs collection of the File or Directory object is used to read, update and delete the Access Control Entries ( ACE) for a file or directory Access Control List (ACL).

Properties

Count, Item (default property)

Methods

Add, Exists, Remove

 

  Properties

Count

Long integer representing the number of ACE objects in the collection.

Access: Read
Default: None

Notes: This property represents the size of the collection.

Example: The following example displays the size of the collection:

' Code showing initialization of the ACEs collection omitted
Response.Write "Count = " & ACEs.Count & "<BR>"

Item

Item(Index)

Returns a specific ACE object within the collection.

Parameter Description
Index String expression representing the name of the Trustee (Group or User) to return or a numeric expression representing the position within the collection of the Trustee to return.

Returns: ACE object

Notes: Because the Item method is the default method for the ACEs collection, the following lines of code are equivalent:

Set Ace = File.ACEs.Item("sam")
Set Ace = File.ACEs("sam")

Example: The following example shows how to retrieve the first ACE from the collection:

' Code showing initialization of the ACEs collection omitted
Set ACE = File.ACEs.Item(1)

 

  Methods

Add

Add TrusteeName, Permissions

Adds the specified Permissions to the Access Control Entry ( ACE) for TrusteeName..

Parameter Description
TrusteeName The group or user the ACE belongs to.
Permissions A long integer containing a bit mask of AF_PERMISSION settings.

Returns: Nothing

Notes: The process calling this function must have permission to change permissions of a file.  For more information see Security Considerations.

Example: The following example adds an ACE to the collection:

' Code showing initialization of the ACEs collection omitted
ACEs.Add "Bill", AF_PERMIT_FULLCONTROL

See Also: Ace.Permissions property, Ace.TrusteeName property

Exists

Exists(TrusteeName)
 
Checks for the existence of a Trustee in the collection.

Parameter Description
TrusteeName String expression representing the name of the Trustee (Group or User).

Returns: Boolean flag set to True if the named Trustee exists in the collection

Notes: None

Example: The following example tests for an ACE in the collection for a particular trustee:

' Code showing initialization of the ACEs collection omitted
If ACEs.Exists("George") Then
    Response.Write "ACE exists<BR>"
Else
    Response.Write "ACE does not exist<BR>"
End If

See Also: Ace.TrusteeName property

Remove

Remove Index

Removes a specific ACE object within the collection.

Parameter Description
Index String expression representing the name of the Trustee to remove or a numeric expression representing the position within the collection of the Trustee to remove.

Returns: Nothing.

Notes: None

Example: The following example removes an ACE from the collection:

' Code showing initialization of the ACEs collection omitted
ACEs.Remove "Chris"

See Also: Ace.TrusteeName property