EventWaitHandleAccessRule 생성자
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
EventWaitHandleAccessRule 클래스의 새 인스턴스를 초기화합니다.
오버로드
| Name | Description |
|---|---|
| EventWaitHandleAccessRule(IdentityReference, EventWaitHandleRights, AccessControlType) |
규칙이 적용되는 사용자 또는 그룹, 액세스 권한 및 지정된 액세스 권한의 EventWaitHandleAccessRule 허용 또는 거부 여부를 지정하여 클래스의 새 인스턴스를 초기화합니다. |
| EventWaitHandleAccessRule(String, EventWaitHandleRights, AccessControlType) |
규칙이 적용되는 사용자 또는 그룹의 이름, 액세스 권한 및 지정된 액세스 권한의 허용 또는 거부 여부를 지정하여 클래스의 새 인스턴스 EventWaitHandleAccessRule 를 초기화합니다. |
EventWaitHandleAccessRule(IdentityReference, EventWaitHandleRights, AccessControlType)
- Source:
- EventWaitHandleSecurity.cs
- Source:
- EventWaitHandleSecurity.cs
- Source:
- EventWaitHandleSecurity.cs
- Source:
- EventWaitHandleSecurity.cs
- Source:
- EventWaitHandleSecurity.cs
- Source:
- EventWaitHandleSecurity.cs
규칙이 적용되는 사용자 또는 그룹, 액세스 권한 및 지정된 액세스 권한의 EventWaitHandleAccessRule 허용 또는 거부 여부를 지정하여 클래스의 새 인스턴스를 초기화합니다.
public:
EventWaitHandleAccessRule(System::Security::Principal::IdentityReference ^ identity, System::Security::AccessControl::EventWaitHandleRights eventRights, System::Security::AccessControl::AccessControlType type);
public EventWaitHandleAccessRule(System.Security.Principal.IdentityReference identity, System.Security.AccessControl.EventWaitHandleRights eventRights, System.Security.AccessControl.AccessControlType type);
new System.Security.AccessControl.EventWaitHandleAccessRule : System.Security.Principal.IdentityReference * System.Security.AccessControl.EventWaitHandleRights * System.Security.AccessControl.AccessControlType -> System.Security.AccessControl.EventWaitHandleAccessRule
Public Sub New (identity As IdentityReference, eventRights As EventWaitHandleRights, type As AccessControlType)
매개 변수
- identity
- IdentityReference
규칙이 적용되는 사용자 또는 그룹입니다. 형식이거나 형식 SecurityIdentifier 으로 NTAccount 변환할 수 있는 형식 SecurityIdentifier이어야 합니다.
- eventRights
- EventWaitHandleRights
허용되거나 거부된 권한을 지정하는 값의 EventWaitHandleRights 비트 조합입니다.
- type
- AccessControlType
AccessControlType 권한이 허용 또는 거부되는지 여부를 지정하는 값 중 하나입니다.
예외
identity형식이 아니거나 형식 SecurityIdentifier 으로 변환NTAccount할 수 있는 형식 SecurityIdentifier 이 아닙니다.
설명
(또는 EventWaitHandle 메서드를 WaitOne 호출 WaitAnyWaitAll 하여) 대기하려면 사용자에게 액세스 권한이 EventWaitHandleRights.Synchronize 있어야 합니다. 메서드를 호출 Set 하여 이벤트를 신호로 보내거나 메서드를 호출 Reset 하여 서명되지 않은 상태로 다시 설정하려면 사용자에게 액세스 권한이 EventWaitHandleRights.Modify 있어야 합니다. 개체에 EventWaitHandle 신호를 표시한 다음 메서드를 호출 SignalAndWait 하여 대기하려면 사용자에게 액세스 권한이 Synchronize 있어야 Modify 합니다.
적용 대상
EventWaitHandleAccessRule(String, EventWaitHandleRights, AccessControlType)
- Source:
- EventWaitHandleSecurity.cs
- Source:
- EventWaitHandleSecurity.cs
- Source:
- EventWaitHandleSecurity.cs
- Source:
- EventWaitHandleSecurity.cs
- Source:
- EventWaitHandleSecurity.cs
- Source:
- EventWaitHandleSecurity.cs
규칙이 적용되는 사용자 또는 그룹의 이름, 액세스 권한 및 지정된 액세스 권한의 허용 또는 거부 여부를 지정하여 클래스의 새 인스턴스 EventWaitHandleAccessRule 를 초기화합니다.
public:
EventWaitHandleAccessRule(System::String ^ identity, System::Security::AccessControl::EventWaitHandleRights eventRights, System::Security::AccessControl::AccessControlType type);
public EventWaitHandleAccessRule(string identity, System.Security.AccessControl.EventWaitHandleRights eventRights, System.Security.AccessControl.AccessControlType type);
new System.Security.AccessControl.EventWaitHandleAccessRule : string * System.Security.AccessControl.EventWaitHandleRights * System.Security.AccessControl.AccessControlType -> System.Security.AccessControl.EventWaitHandleAccessRule
Public Sub New (identity As String, eventRights As EventWaitHandleRights, type As AccessControlType)
매개 변수
- identity
- String
규칙이 적용되는 사용자 또는 그룹의 이름입니다.
- eventRights
- EventWaitHandleRights
허용되거나 거부된 권한을 지정하는 값의 EventWaitHandleRights 비트 조합입니다.
- type
- AccessControlType
AccessControlType 권한이 허용 또는 거부되는지 여부를 지정하는 값 중 하나입니다.
예외
eventRights 가 0입니다.
예제
다음 코드 예제에서는 개체를 만들기 EventWaitHandleAccessRule 위해이 생성자를 사용 하는 방법을 보여 줍니다. 이 예제에서는 개체를 EventWaitHandleSecurity 만들고, 현재 사용자에 대한 다양한 권한을 허용 및 거부하는 규칙을 추가하고, 결과 규칙 쌍을 표시합니다. 그런 다음 현재 사용자에 대한 새 권한을 허용하고 결과를 표시하여 새 권한이 기존 규칙과 병합됨을 Allow 보여 줍니다.
메모
이 예제에서는 보안 개체를 개체에 EventWaitHandle 연결하지 않습니다. 보안 개체를 연결하는 예제는 다음EventWaitHandle.GetAccessControl에서 EventWaitHandle.SetAccessControl 찾을 수 있습니다.
using System;
using System.Threading;
using System.Security.AccessControl;
using System.Security.Principal;
public class Example
{
public static void Main()
{
// Create a string representing the current user.
string user = Environment.UserDomainName + "\\" +
Environment.UserName;
// Create a security object that grants no access.
EventWaitHandleSecurity mSec = new EventWaitHandleSecurity();
// Add a rule that grants the current user the
// right to wait on or signal the event.
EventWaitHandleAccessRule rule = new EventWaitHandleAccessRule(user,
EventWaitHandleRights.Synchronize | EventWaitHandleRights.Modify,
AccessControlType.Allow);
mSec.AddAccessRule(rule);
// Add a rule that denies the current user the
// right to change permissions on the event.
rule = new EventWaitHandleAccessRule(user,
EventWaitHandleRights.ChangePermissions,
AccessControlType.Deny);
mSec.AddAccessRule(rule);
// Display the rules in the security object.
ShowSecurity(mSec);
// Add a rule that allows the current user the
// right to read permissions on the event. This rule
// is merged with the existing Allow rule.
rule = new EventWaitHandleAccessRule(user,
EventWaitHandleRights.ReadPermissions,
AccessControlType.Allow);
mSec.AddAccessRule(rule);
ShowSecurity(mSec);
}
private static void ShowSecurity(EventWaitHandleSecurity security)
{
Console.WriteLine("\r\nCurrent access rules:\r\n");
foreach(EventWaitHandleAccessRule ar in
security.GetAccessRules(true, true, typeof(NTAccount)))
{
Console.WriteLine(" User: {0}", ar.IdentityReference);
Console.WriteLine(" Type: {0}", ar.AccessControlType);
Console.WriteLine(" Rights: {0}", ar.EventWaitHandleRights);
Console.WriteLine();
}
}
}
/*This code example produces output similar to following:
Current access rules:
User: TestDomain\TestUser
Type: Deny
Rights: ChangePermissions
User: TestDomain\TestUser
Type: Allow
Rights: Modify, Synchronize
Current access rules:
User: TestDomain\TestUser
Type: Deny
Rights: ChangePermissions
User: TestDomain\TestUser
Type: Allow
Rights: Modify, ReadPermissions, Synchronize
*/
Imports System.Threading
Imports System.Security.AccessControl
Imports System.Security.Principal
Public Class Example
Public Shared Sub Main()
' Create a string representing the current user.
Dim user As String = Environment.UserDomainName _
& "\" & Environment.UserName
' Create a security object that grants no access.
Dim mSec As New EventWaitHandleSecurity()
' Add a rule that grants the current user the
' right to wait on or signal the event.
Dim rule As New EventWaitHandleAccessRule(user, _
EventWaitHandleRights.Synchronize _
Or EventWaitHandleRights.Modify, _
AccessControlType.Allow)
mSec.AddAccessRule(rule)
' Add a rule that denies the current user the
' right to change permissions on the event.
rule = New EventWaitHandleAccessRule(user, _
EventWaitHandleRights.ChangePermissions, _
AccessControlType.Deny)
mSec.AddAccessRule(rule)
' Display the rules in the security object.
ShowSecurity(mSec)
' Add a rule that allows the current user the
' right to read permissions on the event. This rule
' is merged with the existing Allow rule.
rule = New EventWaitHandleAccessRule(user, _
EventWaitHandleRights.ReadPermissions, _
AccessControlType.Allow)
mSec.AddAccessRule(rule)
ShowSecurity(mSec)
End Sub
Private Shared Sub ShowSecurity(ByVal security As EventWaitHandleSecurity)
Console.WriteLine(vbCrLf & "Current access rules:" & vbCrLf)
For Each ar As EventWaitHandleAccessRule In _
security.GetAccessRules(True, True, GetType(NTAccount))
Console.WriteLine(" User: {0}", ar.IdentityReference)
Console.WriteLine(" Type: {0}", ar.AccessControlType)
Console.WriteLine(" Rights: {0}", ar.EventWaitHandleRights)
Console.WriteLine()
Next
End Sub
End Class
'This code example produces output similar to following:
'
'Current access rules:
'
' User: TestDomain\TestUser
' Type: Deny
' Rights: ChangePermissions
'
' User: TestDomain\TestUser
' Type: Allow
' Rights: Modify, Synchronize
'
'
'Current access rules:
'
' User: TestDomain\TestUser
' Type: Deny
' Rights: ChangePermissions
'
' User: TestDomain\TestUser
' Type: Allow
' Rights: Modify, ReadPermissions, Synchronize
설명
(또는 EventWaitHandle 메서드를 WaitOne 호출 WaitAnyWaitAll 하여) 대기하려면 사용자에게 액세스 권한이 EventWaitHandleRights.Synchronize 있어야 합니다. 메서드를 호출 Set 하여 이벤트를 신호로 보내거나 메서드를 호출 Reset 하여 서명되지 않은 상태로 다시 설정하려면 사용자에게 액세스 권한이 EventWaitHandleRights.Modify 있어야 합니다. 개체에 EventWaitHandle 신호를 표시한 다음 메서드를 호출 SignalAndWait 하여 대기하려면 사용자에게 액세스 권한이 Synchronize 있어야 Modify 합니다.
이 생성자는 생성자에 전달하고 새로 만든 개체를 NTAccount 생성자에 전달 identity 하여 개체를 만드는 NTAccount.NTAccount(String) 것과 NTAccountEventWaitHandleAccessRule(IdentityReference, EventWaitHandleRights, AccessControlType) 같습니다.