DomainService.AuthorizationContext Property

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

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)

protected AuthorizationContext AuthorizationContext { get; set; }

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.