SecureEnvironment.IsUserActivated(ContentUser) 메서드

정의

권한 관리 콘텐츠에 액세스하기 위해 지정된 사용자가 활성화되었는지 여부를 나타냅니다.

public:
 static bool IsUserActivated(System::Security::RightsManagement::ContentUser ^ user);
public static bool IsUserActivated(System.Security.RightsManagement.ContentUser user);
static member IsUserActivated : System.Security.RightsManagement.ContentUser -> bool
Public Shared Function IsUserActivated (user As ContentUser) As Boolean

매개 변수

user
ContentUser

권한 관리 콘텐츠에 대한 액세스 권한을 부여하기 위한 사용자 또는 사용자 그룹입니다.

반품

true 권한 관리 콘텐츠에 액세스하기 위해 지정된 user 항목이 활성화되었으면 이고, false그렇지 않으면 .

예제

다음 예제에서는 지정된 사용자가 권한 관리 콘텐츠에 IsUserActivated 액세스할 수 있는 권한이 있는지 확인하는 방법을 사용합니다.

string applicationManifest = "<manifest></manifest>";
if (File.Exists("rpc.xml"))
{
    StreamReader manifestReader = File.OpenText("rpc.xml");
    applicationManifest = manifestReader.ReadToEnd();
}

if (_secureEnv == null)
{
    if (SecureEnvironment.IsUserActivated(new ContentUser(
                _currentUserId, AuthenticationType.Windows)))
    {
        _secureEnv = SecureEnvironment.Create(
            applicationManifest, new ContentUser(
                _currentUserId, AuthenticationType.Windows));
    }
    else
    {
        _secureEnv = SecureEnvironment.Create(
            applicationManifest,
            AuthenticationType.Windows,
            UserActivationMode.Permanent);
    }
}
Dim applicationManifest As String = "<manifest></manifest>"
If File.Exists("rpc.xml") Then
    Dim manifestReader As StreamReader = File.OpenText("rpc.xml")
    applicationManifest = manifestReader.ReadToEnd()
End If

If _secureEnv Is Nothing Then
    If SecureEnvironment.IsUserActivated(New ContentUser(_currentUserId, AuthenticationType.Windows)) Then
        _secureEnv = SecureEnvironment.Create(applicationManifest, New ContentUser(_currentUserId, AuthenticationType.Windows))
    Else
        _secureEnv = SecureEnvironment.Create(applicationManifest, AuthenticationType.Windows, UserActivationMode.Permanent)
    End If
End If

적용 대상