2 using Microsoft.Win32.SafeHandles;
15 [HostProtection(
SecurityAction.LinkDemand, SecurityInfrastructure =
true)]
20 private string[] m_roles;
24 private bool m_rolesLoaded;
39 if (windowsIdentity !=
null)
43 yield
return userClaim;
59 if (windowsIdentity !=
null)
63 yield
return deviceClaim;
81 if (ntIdentity ==
null)
85 m_identity = ntIdentity;
89 [SecuritySafeCritical]
97 claimsIdentity = identity;
101 if (claimsIdentity ==
null)
103 base.AddIdentity(m_identity);
111 [SecuritySafeCritical]
115 if (role ==
null || role.Length == 0)
121 identityReferenceCollection.
Add(identity);
124 if (securityIdentifier !=
null &&
IsInRole(securityIdentifier))
128 return base.IsInRole(role);
167 [SecuritySafeCritical]
179 SafeAccessTokenHandle phNewToken = SafeAccessTokenHandle.InvalidHandle;
184 bool IsMember =
false;
185 if (!Win32Native.CheckTokenMembership((m_identity.
ImpersonationLevel != 0) ? m_identity.
AccessToken : phNewToken, sid.BinaryForm, ref IsMember))
189 phNewToken.Dispose();
Enables code to check the Windows group membership of a Windows user.
TokenImpersonationLevel ImpersonationLevel
Gets the impersonation level for the user.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
Describes a set of security permissions applied to code. This class cannot be inherited.
override bool IsInRole(string role)
Determines whether the current principal belongs to the Windows user group with the specified name.
void Add(IdentityReference identity)
Adds an T:System.Security.Principal.IdentityReference object to the T:System.Security....
TokenImpersonationLevel
Defines security impersonation levels. Security impersonation levels govern the degree to which a ser...
override IIdentity Identity
Gets the identity of the current principal.
Describes the source and destination of a given serialized stream, and provides an additional caller-...
Represents a user or group account.
virtual IEnumerable< Claim > UserClaims
Gets claims that have the F:System.Security.Claims.ClaimTypes.WindowsUserClaim property key.
Represents a Windows user.
SecurityAction
Specifies the security actions that can be performed using declarative security.
Provides information about, and means to manipulate, the current environment and platform....
An T:System.Security.Principal.IPrincipal implementation that supports multiple claims-based identiti...
virtual IEnumerable< Claim > UserClaims
Gets all Windows user claims from this principal.
Represents a collection of key/value pairs that are organized based on the hash code of the key....
WindowsPrincipal(WindowsIdentity ntIdentity)
Initializes a new instance of the T:System.Security.Principal.WindowsPrincipal class by using the spe...
A platform-specific type that is used to represent a pointer or a handle.
Represents a claims-based identity.
SafeAccessTokenHandle AccessToken
Gets this T:Microsoft.Win32.SafeHandles.SafeAccessTokenHandle for this T:System.Security....
Provides a collection of methods for allocating unmanaged memory, copying unmanaged memory blocks,...
Represents a collection of T:System.Security.Principal.IdentityReference objects and provides a means...
virtual IEnumerable< Claim > DeviceClaims
Gets claims that have the F:System.Security.Claims.ClaimTypes.WindowsDeviceClaim property key.
virtual IEnumerable< Claim > DeviceClaims
Gets all Windows device claims from this principal.
WindowsBuiltInRole
Specifies common roles to be used with M:System.Security.Principal.WindowsPrincipal....
The exception that is thrown when one of the arguments provided to a method is not valid.
virtual bool IsInRole(int rid)
Determines whether the current principal belongs to the Windows user group with the specified relativ...
Represents a security identifier (SID) and provides marshaling and comparison operations for SIDs.
static readonly IntPtr Zero
A read-only field that represents a pointer or handle that has been initialized to zero.
virtual bool IsInRole(SecurityIdentifier sid)
Determines whether the current principal belongs to the Windows user group with the specified securit...
Specifies that the class can be serialized.
override IdentityReference Translate(Type targetType)
Translates the account name represented by the T:System.Security.Principal.NTAccount object into anot...
Defines the basic functionality of an identity object.
static int GetLastWin32Error()
Returns the error code returned by the last unmanaged function that was called using platform invoke ...
virtual bool IsInRole(WindowsBuiltInRole role)
Determines whether the current principal belongs to the Windows user group with the specified T:Syste...
virtual IEnumerable< ClaimsIdentity > Identities
Gets a collection that contains all of the claims identities associated with this claims principal.
The exception that is thrown when a security error is detected.