Using ASP.NET Roles in Silverlight

Very often, user accounts are grouped into roles. Roles are then appended rights in the application and all users in a specific role inherit the rights of the role. Users can be part of more than one role. The ASP.NET Membership API contains an implementation for roles as well. Using the Application Services we already explored in the previous recipe, we can expose role functionality as well so it can be used in a Silverlight application.

In this recipe, we'll extend the application so we can check if users are in a specific role.

Getting ready

This recipe requires that SQL Server or SQL Server Express is installed on your machine, as the code we are creating talks to a database.

To follow along with this recipe, ...

Get Silverlight 4 Data and Services Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.