2.6 Trustees Collection

Lists the trustees of an Entry object (file or directory).

2.6.1 Add method

Adds a new Trustee object to the Trustee collection’s file or directory entry.

Syntax

Object.Add(
 Path As String,
 ObjName As String, 
 Rights As String)

Parameters

Path

The full name of the file or the directory entry.

ObjName

The name of the Trustee object to add.

Rights

The rights for the new Trustee object.R=Read, W=Write, S=Supervisor, A=Access, M=Modify.

Return Values

Trustee.

Example

This example creates the Trustee object ADMIN in NSN directory and assigns it RW (read and write) rights.

Set filemgr = Createobject("ucx:NWFileMgr") 
Set entry = filemgr.FindEntry("Sys:NSN") 
entry.trustees.Add("SYS:NSN","ADMIN","RW")

2.6.2 HasMoreElements method

Determines whether or not the collection contains any more Trustee objects.

Syntax

Object.HasMoreElements()

Parameters

None.

Return Values

Boolean. Returns TRUE if the collection contains more Trustee objects.

Example

See sample in Example.

2.6.3 Next method

Returns the next Trustee object in the collection.

Syntax

Object.Next()

Parameters

None.

Return Values

Trustee. Returns the next Trustee object in the collection. If there are no more objects in the collection, this method returns NULL.

Example

See sample in Example.

2.6.4 Remove method

Deletes the specified Trustee object from the Trustee collection’s file or directory entry.

Syntax

Object.Remove(
 Path As String,
 ObjectName As String)

Parameters

Path

The full name of the file or the directory entry from which the specified trustee object is to be deleted.

ObjectName

The name of the Trustee object to delete.

Return Values

Boolean. Returns TRUE if the Trustee object is successfully removed.

Example

This example removes the ADMIN object from the collection.

Set filemgr = Createobject("ucx:NWFileMgr") 
Set trustee = filemgr.FindEntry("Sys:NSN") 
Set trustees = entry.trustees 
If trustees.Remove("Sys:NSN","ADMIN") Then
 Print("Deleted trustee successfully")
Else
 Print("Unable to delete the trustee")
End If

2.6.5 Reset method

Resets the collection of Entry objects.

Syntax

Object.Reset()

Parameters

None.

Return Values

Void.

Remarks

This method is the first operation that starts the iteration over files and directories.

Example

See sample in Example.

See Also