DomainService.AuthorizationContext Property

[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.]

Gets or sets the optional template AuthorizationContext to use for IsAuthorized.

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

Syntax

'Declaration
Protected Property AuthorizationContext As AuthorizationContext
    Get
    Set
'Usage
Dim value As AuthorizationContext

value = Me.AuthorizationContext

Me.AuthorizationContext = value
protected AuthorizationContext AuthorizationContext { get; set; }
protected:
property AuthorizationContext^ AuthorizationContext {
    AuthorizationContext^ get ();
    void set (AuthorizationContext^ value);
}
member AuthorizationContext : AuthorizationContext with get, set
function get AuthorizationContext () : AuthorizationContext
function set AuthorizationContext (value : AuthorizationContext)

Property Value

Type: System.ComponentModel.DataAnnotations.AuthorizationContext
The template to use for IsAuthorized.

Remarks

This property may be set by the developer at any time to serve as the template for authorization of each DomainOperationEntry. The Initialize method is the preferred place to set this property. The recommended construction pattern is to specify ServiceContext as the template's IServiceProvider. If you do not set this property, a default one will be created following that pattern.

This property is intended to allow a developer to provide additional state information or services in the AuthorizationContext that can be used by the IsAuthorized implementation logic for all AuthorizationAttribute subclasses.

This optional template value is not passed directly to IsAuthorized, but instead is used as the source from which to clone the actual AuthorizationContext.

The template will be used as the parent IServiceProvider. Because AuthorizationContext implements IDisposable, the value set in this property must be disposed explicitly by the developer.

See Also

Reference

DomainService Class

System.ServiceModel.DomainServices.Server Namespace