|
Este artículo proviene de un motor de traducción automática. Mueva el puntero sobre las frases del artículo para ver el texto original. Más información.
|
Traducción
Original
|
AuthorizationContext (Clase)
Espacio de nombres: System.IdentityModel.Policy
Ensamblado: System.IdentityModel (en System.IdentityModel.dll)
El tipo AuthorizationContext expone los siguientes miembros.
| Nombre | Descripción | |
|---|---|---|
![]() | AuthorizationContext |
| Nombre | Descripción | |
|---|---|---|
![]() | ClaimSets | |
![]() | ExpirationTime | |
![]() | Id | |
![]() | Properties |
| Nombre | Descripción | |
|---|---|---|
![]() ![]() | CreateDefaultAuthorizationContext | |
![]() | Equals(Object) | |
![]() | Finalize | |
![]() | GetHashCode | |
![]() | GetType | |
![]() | MemberwiseClone | |
![]() | ToString |
protected override bool CheckAccessCore(OperationContext operationContext) { // Extract the action URI from the OperationContext. Match this against the claims // in the AuthorizationContext. string action = operationContext.RequestContext.RequestMessage.Headers.Action; Console.WriteLine("action: {0}", action); // Iterate through the various claim sets in the AuthorizationContext. foreach(ClaimSet cs in operationContext.ServiceSecurityContext.AuthorizationContext.ClaimSets) { // Examine only those claim sets issued by System. if (cs.Issuer == ClaimSet.System) { // Iterate through claims of type "http://example.org/claims/allowedoperation". foreach (Claim c in cs.FindClaims("http://example.org/claims/allowedoperation", Rights.PossessProperty)) { // Write the Claim resource to the console. Console.WriteLine("resource: {0}", c.Resource.ToString()); // If the Claim resource matches the action URI then return true to allow access. if (action == c.Resource.ToString()) return true; } } } // If this point is reached, return false to deny access. return false; }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (no se admite el rol Server Core), Windows Server 2008 R2 (se admite el rol Server Core con SP1 o versiones posteriores; no se admite Itanium)
.NET Framework no admite todas las versiones de todas las plataformas. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.
