SecurityCallContext.DirectCaller プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > SecurityCallContext.DirectCaller プロパティの意味・解説 

SecurityCallContext.DirectCaller プロパティ

このメソッド直接呼び出し元を説明する SecurityIdentity オブジェクト取得します

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

Public ReadOnly Property
 DirectCaller As SecurityIdentity
Dim instance As SecurityCallContext
Dim value As SecurityIdentity

value = instance.DirectCaller
public SecurityIdentity DirectCaller { get;
 }
public:
property SecurityIdentity^ DirectCaller {
    SecurityIdentity^ get ();
}
/** @property */
public SecurityIdentity get_DirectCaller ()
public function get DirectCaller
 () : SecurityIdentity

プロパティ
SecurityIdentity 値。

使用例使用例

このメソッド使用して、ServicedComponent メソッド直接呼び出し元の ID確認する方法コード例次に示します

' Get the employee's salary. Only the employee and managers can do this.
Public Function GetSalary() As
 Double 
    If SecurityCallContext.CurrentCall.DirectCaller.AccountName
 = accountName OrElse SecurityCallContext.CurrentCall.IsCallerInRole("Manager")
 Then
        Return salary
    Else
        Throw New UnauthorizedAccessException()
    End If

End Function 'GetSalary
// Get the employee's salary. Only the employee and managers can do
 this.
public double GetSalary ()
{
    if ( SecurityCallContext.CurrentCall.DirectCaller.AccountName
 == accountName ||
         SecurityCallContext.CurrentCall.IsCallerInRole("Manager") )
    {
        return(salary);
    }
    else
    {
      throw new UnauthorizedAccessException();
    }
}
// Get the employee's salary. Only the employee and managers can do
 this.
double GetSalary()
{
   if ( SecurityCallContext::CurrentCall->DirectCaller->AccountName
 == accountName || SecurityCallContext::CurrentCall->IsCallerInRole( "Manager"
 ) )
   {
      return (salary);
   }
   else
   {
      throw gcnew UnauthorizedAccessException;
   }
}
// Get the employee's salary. Only the employee and managers can do
 this.
public double GetSalary() throws System.UnauthorizedAccessException
{
    if (SecurityCallContext.get_CurrentCall().get_DirectCaller().
        get_AccountName().Equals(accountName) 
        || SecurityCallContext.get_CurrentCall().
        IsCallerInRole("Manager")) {
        return salary;
    }
    else {
        throw new UnauthorizedAccessException();
    }
} //GetSalary
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

SecurityCallContext.DirectCaller プロパティのお隣キーワード
検索ランキング

   

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



SecurityCallContext.DirectCaller プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS