The following example demonstrates creating and testing a privileged routine application. Before beginning the example, you must complete the following preliminary steps. Note that you may well have completed the first three steps for an earlier example in this tutorial.
-
If you have not already done so, add a user (user name is JSmith, password is JSmith) to InterSystems IRIS. Read Creating a User for instructions.
-
If you have not already done so, add a resource (SecurityTutorialResource) to InterSystems IRIS. Read Creating a Resource for instructions.
-
If you have not already done so, create a role (SecurityTutorialRole). Add the SecurityTutorialResource to the role with Use permissions. Read Creating A Role for instructions.
-
Create another new role named PrivRoutineRole. Read Creating A Role for instructions.
-
Add the user JSmith to the %Developer role, but not the SecurityTutorialRole. If JSmith is already a member of SecurityTutorialRole, remove JSmith from the role. Read Adding a User to a Role for instructions. Note that the instructions show adding the user to the SecurityTutorialRole role. In this case you want to add the user to %Developer.
-
Finally, create the class SecurityTutorial.PrivilegedRoutineExample, in the USER namespace. See Code for Privileged Routine Example for an example of how to write a class method in this class, as well as a brief description of what each line does.