Role based security

Discussion in 'ASP .Net' started by mrajanikrishna@gmail.com, May 4, 2008.

  1. Guest

    Hi friends,

    I am developing an application. Most of the pages include a form to
    insert data, griview to display, selecting a record in gridview to
    edit or delete...
    But, I have different roles to users of my application. Some users are
    allowed to add, edit and delete. Some to add only. Some to add and
    edit.

    How can I create roles and disable them to perform an action based on
    the role. Truly say, button based security.

    How can I achieve this.

    Thanks in advance
    , May 4, 2008
    #1
    1. Advertising

  2. sloan Guest

    You need to look at the
    MembershipProvider
    and more importantly
    the
    RoleProvider

    btnEdit.Enabled = RoleProvider.IsUserInRole("Admin")


    http://msdn.microsoft.com/en-us/library/system.web.security.roleprovider.isuserinrole.aspx


    My code above will not work until after you have RESEARCHED and implemented
    a RoleProvider.

    DotNet 2.0 and above has a default one. Google it, there are a billion
    articles about it.

    But hopefully, this will get you on the right track.





    <> wrote in message
    news:...
    > Hi friends,
    >
    > I am developing an application. Most of the pages include a form to
    > insert data, griview to display, selecting a record in gridview to
    > edit or delete...
    > But, I have different roles to users of my application. Some users are
    > allowed to add, edit and delete. Some to add only. Some to add and
    > edit.
    >
    > How can I create roles and disable them to perform an action based on
    > the role. Truly say, button based security.
    >
    > How can I achieve this.
    >
    > Thanks in advance
    sloan, May 5, 2008
    #2
    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. Jesper Stocholm
    Replies:
    2
    Views:
    8,104
    John Saunders
    Aug 23, 2003
  2. Liet Kynes
    Replies:
    0
    Views:
    490
    Liet Kynes
    Nov 26, 2003
  3. Boris Condarco

    Custom Role Based Security

    Boris Condarco, Nov 28, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    845
    Tommy
    Nov 28, 2003
  4. sean

    Role Based Security

    sean, May 27, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    349
    Steve C. Orr [MVP, MCSD]
    May 27, 2004
  5. Kursat
    Replies:
    1
    Views:
    314
    Dominick Baier
    May 7, 2007
Loading...

Share This Page