SecurityCallContext.IsCallerInRole メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > SecurityCallContext.IsCallerInRole メソッドの意味・解説 

SecurityCallContext.IsCallerInRole メソッド

直接の呼び出し元が、指定されたロールのメンバかどうかを検査します。

名前空間: System.EnterpriseServices
アセンブリ: System.EnterpriseServices (system.enterpriseservices.dll 内)
構文構文

Public Function IsCallerInRole ( _
    role As String _
) As Boolean
Dim instance As SecurityCallContext
Dim role As String
Dim returnValue As Boolean

returnValue = instance.IsCallerInRole(role)
public bool IsCallerInRole (
    string role
)
public:
bool IsCallerInRole (
    String^ role
)
public boolean IsCallerInRole (
    String role
)
public function IsCallerInRole (
    role : String
) : boolean

パラメータ

role

指定されたロール。

戻り値
直接の呼び出し元が、指定されたロールのメンバである場合は true。それ以外の場合は false。

使用例使用例

このメソッドを使用して、ServicedComponent メソッドの呼び出し元が指定されたロールに存在するかどうかを確認する方法のコード例を次に示します。

' Set the employee's salary. Only managers can do this.
Public Sub SetSalary(ByVal
 ammount As Double) 
    If SecurityCallContext.CurrentCall.IsCallerInRole("Manager")
 Then
        salary = ammount
    Else
        Throw New UnauthorizedAccessException()
    End If

End Sub 'SetSalary
// Set the employee's salary. Only managers can do this.
public void SetSalary (double ammount)
{
    if (SecurityCallContext.CurrentCall.IsCallerInRole("Manager"))
    {
        salary = ammount;
    }
    else
    {
        throw new UnauthorizedAccessException();
    }
}
// Set the employee's salary. Only managers can do this.
void SetSalary( double ammount )
{
   if ( SecurityCallContext::CurrentCall->IsCallerInRole( "Manager"
 ) )
   {
      salary = ammount;
   }
   else
   {
      throw gcnew UnauthorizedAccessException;
   }
}
// Set the employee's salary. Only managers can do this.
public void SetSalary(double ammount) 
    throws System.UnauthorizedAccessException
{
    if (SecurityCallContext.get_CurrentCall().IsCallerInRole("Manager"))
 {
        salary = ammount;
    }
    else {
        throw new UnauthorizedAccessException();
    }
} //SetSalary
.NET Framework のセキュリティ.NET Framework のセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からSecurityCallContext.IsCallerInRole メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からSecurityCallContext.IsCallerInRole メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からSecurityCallContext.IsCallerInRole メソッド を検索

英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

SecurityCallContext.IsCallerInRole メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



SecurityCallContext.IsCallerInRole メソッドのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS