The IsAvailableObject method is used to determine the current access permissions rights to an object.
Syntax for method invocation:
...
The method returns 0 if the current user has not been assigned permissions rights of the the param type to access the object. The method returns 1 if permissions rights 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 rights to which you want to find outclarify. 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 rights that you want to find out if they exist. A description of permissions rights is given in Restriction of administration, control, and monitoring rights. Possible values:
- 0—rightsNoView access permissionsrights. The method will return 1 if there are no administrative, control, or monitoring permissions rights to the object (red "x").
- 1—rightsNoControl access permissionsrights. The method will return 1 if there are only monitoring permissions rights (letter M).
- 2—rightsViewAndControl access permissionsrights. The method will return 1 if there are control and monitoring permissions rights to the object (green checkbox).
- 3—rightsViewOrControl access permissionsrights. The method will return 1 if there is are either monitoring or control permissions rights to the object.
- 4—rightsNot access permissionsrights.
- 5—rightsConfigure access permissionsrights. The method will return 1 if there are administrative, control, and monitoring permissions rights 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 rights to the object.
| Code Block |
|---|
var i = 0;
for(i = 0; i <= 5; i++)
{
var result =
IsAvailableObject('Comp','CAM','1', i);
DebugLogString("right "+i+" = "+result);
} |