Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new tab

For information on migrating to InterSystems IRISOpens in a new tab, see Why Migrate to InterSystems IRIS?

例 : 特権ルーチン・アプリケーションの実行

前のページで説明した手順を完了したら、次は、MyPrivilegedRoutineApplication をテストします。この例では、ユーザ JSmith で、1 回は %Developer のみのメンバーとして、もう 1 回は SecurityTutorialRole と %Developer のメンバーとして、合計 2 回、PrivRoutineExample ルーチンを実行します。

最初のケースでは、JSmith は %Developer のメンバですが、SecurityTutorialRole のメンバではありません。

  1. JSmith が %Developer のメンバであるが、SecurityTutorialRole のメンバではないことを確認します。手順については、"ロールへのユーザの追加" を参照してください。

  2. システム・トレイの [InterSystems ランチャー] をクリックすることでターミナルを開きます。

  3. ターミナルが USER ネームスペースで開かない場合は、ZN コマンドを使用して、USER ネームスペースに変更します。

    
    DOCBOOK>ZN "USER"
    USER>
    
    
  4. $SYSTEM.Security.Login を使用して、JSmith としてログインします。

    
    USER>Write $SYSTEM.Security.Login("JSmith","JSmith")
    1
    
    
  5. 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 のメンバではないためです。

  6. ターミナルを閉じます。

2 つ目のケースでは、JSmith は %Developer と SecurityTutorialRole の両方のメンバです。

  1. 管理ポータルを使用して、JSmith を SecurityTutorialRole に追加します。手順については、"ロールへのユーザの追加" を参照してください。

  2. ターミナルを開きます。必要に応じて、USER ネームスペースに変更します。

  3. $SYSTEM.Security.Login を使用して、JSmith としてログインします。

  4. もう一度、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 に追加されます。

FeedbackOpens in a new tab