例 : 特権ルーチン・アプリケーションの実行
前のページで説明した手順を完了したら、次は、MyPrivilegedRoutineApplication をテストします。この例では、ユーザ JSmith で、1 回は %Developer のみのメンバーとして、もう 1 回は SecurityTutorialRole と %Developer のメンバーとして、合計 2 回、PrivRoutineExample ルーチンを実行します。
最初のケースでは、JSmith は %Developer のメンバですが、SecurityTutorialRole のメンバではありません。
-
JSmith が %Developer のメンバであるが、SecurityTutorialRole のメンバではないことを確認します。手順については、"ロールへのユーザの追加" を参照してください。
-
システム・トレイの [InterSystems ランチャー] をクリックすることでターミナルを開きます。
-
ターミナルが USER ネームスペースで開かない場合は、ZN コマンドを使用して、USER ネームスペースに変更します。
DOCBOOK>ZN "USER" USER>
-
$SYSTEM.Security.Login を使用して、JSmith としてログインします。
USER>Write $SYSTEM.Security.Login("JSmith","JSmith") 1
-
PrivRoutineExample を実行します。
USER>Do ^PrivRoutineExample Welcome to the Privileged App Routine User before: JSmith Roles before: %Developer User after: JSmith Roles after: %Developer
このルーチンは JSmith をいずれのロールにも追加しない点に注意してください。これは JSmith が SecurityTutorialRole のメンバではないためです。
-
ターミナルを閉じます。
2 つ目のケースでは、JSmith は %Developer と SecurityTutorialRole の両方のメンバです。
-
管理ポータルを使用して、JSmith を SecurityTutorialRole に追加します。手順については、"ロールへのユーザの追加" を参照してください。
-
ターミナルを開きます。必要に応じて、USER ネームスペースに変更します。
-
$SYSTEM.Security.Login を使用して、JSmith としてログインします。
-
もう一度、PrivRoutineExample を実行します。
USER>Do ^PrivRoutineExample Welcome to the Privileged App Routine User before: JSmith Roles before: %Developer,SecurityTutorialRole User after: JSmith Roles after: %Developer,PrivRoutineRole,SecurityTutorialRole
今回は、JSmith が PrivRoutineRole に追加されます。