SecurityCallContext.CurrentCall 속성

정의

보안 호출 컨텍스트를 설명하는 SecurityCallContext 개체를 가져옵니다.

public:
 static property System::EnterpriseServices::SecurityCallContext ^ CurrentCall { System::EnterpriseServices::SecurityCallContext ^ get(); };
public static System.EnterpriseServices.SecurityCallContext CurrentCall { get; }
static member CurrentCall : System.EnterpriseServices.SecurityCallContext
Public Shared ReadOnly Property CurrentCall As SecurityCallContext

속성 값

보안 호출 컨텍스트를 설명하는 SecurityCallContext 개체입니다.

예제

다음 코드 예제에서는 가져오려면이 메서드를 사용 하는 방법을 보여 줍니다는 SecurityCallContext 메서드 호출의 보안 컨텍스트를 설명 하는 개체입니다.

// 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)
{
    if (SecurityCallContext.CurrentCall.IsCallerInRole("Manager"))
    {
        salary = ammount;
    }
    else
    {
        throw new UnauthorizedAccessException();
    }
}
' 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

설명

정적 CurrentCall 속성은 보안 호출 컨텍스트를 액세스 하는 것이 좋습니다.

적용 대상