13.5 VolumeRestrictions Collection

Represents a collection of restrictions for all users on a NetWare volume.

13.5.1 Element method

Returns the restriction information for a specified user.

Syntax

object.Element( 
   UserName As String)

Parameters

UserName

The name of the User object.

Return Values

VolumeRestriction.

Example

This example returns the restriction information about user TestUser.

Set volmgr = CreateObject ("UCX:VolumeMgr") 
Set volumes = volmgr.Volumes 
Set volume = Volumes.Element("Sys") 
If (Err.Number = 0) then 
     Set RestrictionsObj = volume.GetSpaceRestriction () 
     If (Err.Number = 0) then 
        Set restr = RestrictionsObj.Element("guest") 
        If (Err.Number = 0) then 
         Print "The restriction volume limit for "&restr.Name
& " is " &restr.VolumeLimit
        Else 
         Print("Failed to find restriction for the specified
user " & Err.Description ) 
        Endif 
     Else 
         Print ("Failed to get restrictions object " &
Err.Description) 
     Endif 
Else 
     Print ("Failed to find the volume " & Err.Description) 
Endif

13.5.2 HasMoreElements method

Determines whether the collection contains more VolumeRestriction objects.

Syntax

Object.HasMoreElements()

Parameters

None.

Return Values

Boolean. Returns TRUE if the collection contains more VolumeRestriction objects; otherwise, FALSE.

Example

This sample returns the restriction limit for the volume restriction objects by searching for all the restriction objects in the volume Sys.

Set volmgr = CreateObject ("UCX:VolumeMgr") 
Set vols = volmgr.volumes 
Set volume = Vols.Element("Sys") 
If (Err.Number=0) then 
     Set RestrictionsObj = volume.GetSpaceRestriction() 
     If (Err.Number=0) then 
        RestrictionsObj.Reset()
        While RestrictionsObj.HasMoreElements() 
          Set restr = RestrictionsObj.Next()
          Print "The restriction volume limit for "&restr.Name
 " is " &restr.VolumeLimit 
        Wend 
     Else 
        Print "Failed to get restrictions object " &
Err.Description 
     Endif 
Else 
     Print "Failed to find the volume " & Err.Description 
Endif

13.5.3 Next method

Returns the next VolumeRestriction object, or NULL if no other objects exist.

Syntax

object.Next()

Parameters

None.

Return Values

VolumeRestriction.

Remarks

Returns Null if no volume restriction object exists.

Example

See sample in Example.

13.5.4 Reset method

Initiates a search for all restrictions on a specified volume.

Syntax

object.Reset()

Parameters

None.

Return Values

Void.

Example

See sample in Example.