User Authorization System |
In the robot controller there is a system controlling user access: the User Authorization System. If this feature is used, each user needs a user name and a password to log on to a robot controller via the FlexPendant or RobotStudio. If the controller connection for any reason is lost, you have to log on again.
The controller holds information on which operations different users are allowed to perform. The UAS configuration is done in RobotStudio.
![]() |
---|
To learn more about UAS use the help function in RobotStudio. |
Before sensitive controller operations are performed, a FlexPendant SDK application should check that you are currently logged on and have the corresponding UAS rights.
Accessing UAS is done by using the property AuthorizationSystem on the controller object:
UserAuthorizationSystem uas = this.aController.AuthorizationSystem;
Dim UAS As UserAuthorizationSystem = Me.AController.AuthorizationSystem
UAS rights are called Grants. The specific user belongs to one of several defined Groups, where each group has a number of specified grants.
To ensure that you have necessary grants to perform an operation, you use the CheckDemandGrant method on the AuthorizationSystem object. The grant to check is passed as an argument:
if (uas.CheckDemandGrant(Grant.ModifyRapidProgram)) {
aTask.LoadModuleFromFile(localFile, RapidLoadMode.Replace);
}
If uas.CheckDemandGrant(Grant.ModifyRapidProgram) Then aTask.LoadModuleFromFile(localFile, RapidLoadMode.Replace) End If
![]() |
---|
The FlexPendant SDK application cannot override the UAS configuration. This means that the system will in the end prevent you from performing an action that is not allowed. |
If a UAS grant is missing you should get information about it. This can be done in a message as shown in the following example:
msg = "You are not allowed to perform this operation, talk to your system administrator if you need access."
title = "User Authorization System"GTPUMessageBox.Show(this, null, msg, title, System.Windows.Forms.MessageBoxIcon.Asterisk, System.Windows.Forms.MessageBoxButtons.OK);
GTPUMessageBox.Show(Me, Nothing, msg, title, System.Windows.Forms.MessageBoxIcon.Asterisk, System.Windows.Forms.MessageBoxButtons.OK)
Another possibility is to retrieve all grants for the current user calling GetCurrentGrants, then iterate over the grants collection and search the necessary grants.
Yet another solution is to call DemandGrant with one of the static Grant members as in argument.
If you do not have the specified grant the FlexPendant SDK throws a UasRejectException and the PC SDK throws a GrantDemandRejectedException.
![]() |
---|
For more information on UAS and Grant members, see Reference Manual FlexPendant SDK. |