Enables access to the ASP.NET role provider as a WCF Web service.
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
[ServiceBehaviorAttribute(Namespace = "http://asp.net/ApplicationServices/v200", InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple)] [ServiceContractAttribute(Namespace = "http://asp.net/ApplicationServices/v200")] [AspNetCompatibilityRequirementsAttribute(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)] [AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] public class RoleService
The object enables you to read a user's roles through a Windows Communication Foundation (WCF) service. To use the role service, you must enable the role service on a Web server and then connect a WCF-compatible client application to the Web service. For information about how to configure the role service, see How to: Enable the WCF Role Service.
The user must be authenticated to read the user's roles. The role service works with any kind of ASP.NET authentication. For information about how to log users in through a WCF service, see Windows Communication Foundation Authentication Service Overview.
The class exposes two methods that should be accessed only through a WCF service: the GetRolesForCurrentUser method and the IsCurrentUserInRole method. The GetRolesForCurrentUser method returns all the roles for the logged-in user. The IsCurrentUserInRole method determines whether the user is in a specified role.
For an example of how to use the WCF role service from a console application, see Walkthrough: Using ASP.NET Application Services.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.