AzMan Authorization RRS feed

  • Question

  • Hi there,
    I hav created Authorization policy using AzMan(Authorization Manager).
    Assigned Active directory Groups&Users to the application roles created using Azman.
    I can able to check whether the provided User is belongs to the roles or not by the following code,

    //Code to create role.
    if (!Roles.RoleExists("TestRole"))

    Code to check whether the provided user belongs to the role "TestRole".

    but dont know how to get the respective operations and tasks for the provided user.
    Pls,let me know how to get it.

    Monday, November 10, 2008 1:03 PM

All replies

  • Hi Thiru,


    Here is the sample code which might be helpful for you -


    public class RoleAttribute : Attribute


    public RoleAttribute()


    CreateRole = DefaultRole;


    public RoleAttribute(Role role)


    CreateRole = role;


    public Role CreateRole


    get { return this.createRole; }

    set { this.createRole = value; }


    private Role createRole = 0;

    public const Role DefaultRole = Role.Administrator

    | Role.BackupOperator;




    RoleAttribute, instead of taking an array, would only take a single argument of flags (appropriately or-ed). If the underlying type of the Role enum is long or ulong, that gives you 64 different Roles.


    Hope above helps.


    Thursday, November 13, 2008 12:02 AM

  • Thanks Pooja,
    Im afraid,did u get my query r not.
    Let me elobrate my requirement .
    Im using Asp.net Role manager for
    the task of managing roles and performing role-based authorization in my appln.
    And Im using AuthorizationStoreRoleProvider to connect to the Azman policy store created in ADAM using AzMan(a part of MMC).

    In my .net application I know how to check the user's role using Role Manager API as follows,



    but dono how to retrieve Corresponding operation or task for the Role of a provided user.
    Clearly ,I dont want to create or define role,tasks and operations using .net application ,as I did the same using AzMan.

    Saturday, November 15, 2008 7:03 AM