Advice on Application Roles?

Discussion in 'ASP .Net' started by =?Utf-8?B?Qw==?=, May 7, 2006.

  1. Hi,

    I have an ASP.NET application.

    I have a serious of tabs on the default page.

    Each tab is link to another ASPX Page.

    Each user in my application will have a role.

    Based on this I want to hide certain tabs on my default page and restrict
    access to certain pages.

    So for example, I may hide a tab but if a user tries to access the page by
    typing in the name of the ASPX I want to check on each ASPX Page if the user
    has the role required to access this page.

    My Database has a table which indicates what role each user has.
    (Example Roles : Basic User, Helpdesk User, Application Administrator )

    What is the best way to hanlde this role based approach in my ASP.NET App?

    Any advice on how to implement this would be appreciated.

    Thanks.
     
    =?Utf-8?B?Qw==?=, May 7, 2006
    #1
    1. Advertising

  2. =?Utf-8?B?Qw==?=

    V Guest

    Hi,

    One way is to have a base page and have all of your pages derive from
    the base page. On each of your page you can specify which roles are
    required to access this page (or you can keep this information in the
    database). On the base page, add code to check the membership of the
    user by comparing his roles, and those required by the current page
    (either by obtaining them from the page or the database).

    The best way to attach roles to the current user is by implementing the
    IPrincipal interface and attaching them to the currentUser object.
    There are plenty of articles available on this.

    Regards,
    Vaibhav
     
    V, May 7, 2006
    #2
    1. Advertising

  3. Set up the required roles for each sub-folder in web.config
     
    Peter Morris [Droopy eyes software], May 8, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Asun Friere
    Replies:
    1
    Views:
    507
    Paul Boddie
    Aug 27, 2003
  2. Peter Hansen
    Replies:
    23
    Views:
    878
    Anton Vredegoor
    Sep 5, 2003
  3. Gerrit Holl
    Replies:
    16
    Views:
    625
    Tom Plunket
    Aug 29, 2003
  4. Asun Friere
    Replies:
    0
    Views:
    482
    Asun Friere
    Aug 28, 2003
  5. Jéjé
    Replies:
    0
    Views:
    238
    Jéjé
    Sep 27, 2005
Loading...

Share This Page