Get list of users belonging to a role using Authorization Manager (AzMan)

Posted by Sam on Stack Overflow See other posts from Stack Overflow or by Sam
Published on 2010-04-08T11:46:08Z Indexed on 2010/04/12 10:13 UTC
Read the original article Hit count: 387

Using ASP.NET (C#) I have set up Authorization Manager to allow me to handle roles on a website. Added users to roles is simple Roles.AddUserToRole("DOMAIN\\UserName", "role"). However I want to list the users belonging to a role, but since they are stored as SID's, displaying them would not be that helpful. To get the users, I am thinking XML would have to be used, although is it possible to use COM Interop to both do that and get the user name? Either way, how can I get the users belonging to a role?

The table to manage roles would basically be like this:

Role    User
----    ----
admin   DOMAIN\UserName [delete]
        DOMAIN\UserName2 [delete]
        [add user text box]
news    DOMAIN\UserName3 [delete]
        [add user text box]

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about c#