Export (0) Print
Expand All

AuthorizationAttribute.Authorize Method

WCF RIA Services

[WCF RIA Services Version 1 Service Pack 2 is compatible with either .NET framework 4 or .NET Framework 4.5, and with either Silverlight 4 or Silverlight 5.]

Determines whether the given principal object is authorized to perform a specific operation described by the given AuthorizationContext.

Namespace:  System.ComponentModel.DataAnnotations
Assembly:  System.ServiceModel.DomainServices.Server (in System.ServiceModel.DomainServices.Server.dll)

public AuthorizationResult Authorize(
	IPrincipal principal,
	AuthorizationContext authorizationContext
)

Parameters

principal
Type: System.Security.Principal.IPrincipal
The IPrincipal to be authorized.
authorizationContext
Type: System.ComponentModel.DataAnnotations.AuthorizationContext
The AuthorizationContext describing the context in which authorization has been requested.

Return Value

Type: System.ComponentModel.DataAnnotations.AuthorizationResult
An AuthorizationResult object that indicates whether the operation is allowed or denied. Returns Allowed when the operation is allowed. Returns a non-null AuthorizationResult when the request has been denied. The ErrorMessage property contains the error message that is displayed to users.

ExceptionCondition
ArgumentNullException

principal or authorizationContext is null.

This method is the entry point for authorization. It delegates to the derived class's IsAuthorized method for implementation-specific authorization.

Show:
© 2014 Microsoft