docs.intersystems.com
Home  /  Security Features of InterSystems IRIS  /  Security Tutorial  /  Code for Privileged Routine Example


Security Tutorial
Code for Privileged Routine Example
[Back]  [Next] 
InterSystems: The power behind what matters   
Search:  


Here is the code for the privileged routine example. Create the class using Atelier.
Class SecurityTutorial.PrivilegedRoutineExample
{

ClassMethod PrivilegedRoutineEx(){

    Write !, "Welcome to the Privileged App Routine"
    Write !, "User before: ", $USERNAME
    Write !, "Roles before: ", $ROLES

    Set status=$System.Security.AddRoles("MyPrivilegedRoutineApplication")

    Write !, "User after: ", $USERNAME
    Write !, "Roles after: ", $ROLES
}

}