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セキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

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

   

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



SecurityCallContext.IsCallerInRole メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS