Using the Roles Application Programming Interface

The Roles class exposes the main application programming interface for manipulating roles. If you need to create roles programmatically, delete roles, or assign users to roles; then you use the methods of the Roles class.

The Roles class includes the following methods:

AddUsersToRole Enables you to add an array of users to a role.

AddUsersToRoles Enables you to add an array of users to an array of roles.

AddUserToRole Enables you to add a user to a role.

AddUserToRoles Enables you to add a user to an array of roles.

CreateRole Enables you to create a new role.

DeleteCookie Enables you to delete the roles cookie.

DeleteRole Enables you to delete a particular role.

FindUsersInRole ...

Get ASP.NET 4 Unleashed 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.