The IsAvailableObject method is used to determine the current access permissions to an object.
Syntax for method invocation:
function IsAvailableObject(compname: String, objtype: String, id: String, param : String) : String
The method returns 0 if the current user has not been assigned permissions of the param type to access the object. The method returns 1 if permissions have been assigned.
Method arguments:
- compname is a required argument. It corresponds to the name of the Computer object on the basis of which the object was created in the hardware tree.
- objtype is a required argument. It corresponds to the type of the system object access permissions to which you want to find out. Possible values: String type, range is limited by object types registered in the system.
- id is a required argument. It corresponds to the identification (registration) number of the object specified by the objtype argument. Possible values: String type, range is limited by the identification numbers of objects of the specified type registered in the system.
- param is a required argument. It corresponds to the number of the type of permissions that you want to find out if they exist. A description of permissions is given in Limiting access to the system objects administration, control and viewing functions. Possible values:
- 0—rightsNoView access permissions. The method will return 1 if there are no administrative, control, or monitoring permissions to the object (red "x").
- 1—rightsNoControl access permissions. The method will return 1 if there are only monitoring permissions (letter M).
- 2—rightsViewAndControl access permissions. The method will return 1 if there are control and monitoring permissions to the object (green checkbox).
- 3—rightsViewOrControl access permissions. The method will return 1 if there is either monitoring or control permissions to the object.
- 4—rightsNot access permissions.
- 5—rightsConfigure access permissions. The method will return 1 if there are administrative, control, and monitoring permissions to the object (grey checkbox).
Example. A Camera object with the identifier 1 has been created in the hardware tree on the basis of the Computer object with the "Comp" name. Find out the current access permissions to the object.
var i = 0;
for(i = 0; i <= 5; i++)
{
var result =
IsAvailableObject('Comp','CAM','1', i);
DebugLogString("right "+i+" = "+result);
}