Search Results for

    Show / Hide Table of Contents

    User Authorization system

    Overview

    In the robot controller there is a system controlling user access: the User Authorization System (UAS). If this feature is used each user needs a user name and a password to log on to a robot controller via RobotStudio. If the controller connection for any reason is lost, you need to log on again.

    The controller holds information on which operations different users are allowed to perform. The UAS configuration is done in RobotStudio.

    Tip

    To learn more about UAS use the help function in RobotStudio.

    Accessing UAS from custom applications

    Accessing UAS is done by using the property AuthorizationSystem on the controller object:

    UserAuthorizationSystem uas = aController.AuthenticationSystem;
    

    Grants and Groups

    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 the necessary grant 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.LoadRapidProgram))
    {
        aTask.LoadModuleFromFile(localFile, RapidLoadMode.Replace);
    }
    
    Note

    The PC 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.

    MessageBox feedback

    If a UAS grant is missing, you should be informed about it. This can be done in a message as shown in this example:

    string msg = "You are not allowed to perform this operation, " +
                 "talk to your system administrator if you need access.";
    string title = "User Authorization System";
    MessageBox.Show(msg, title, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
    

    GetCurrentGrants and DemandGrant

    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 PC SDK throws a GrantDemandRejectedException.

    Tip

    Learn more about UAS and Grant members in the Reference Manual PC SDK.

    In This Article
    Back to top Copyright © 2025 ABB