Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Role based security

2 views
Skip to first unread message

mrajani...@gmail.com

unread,
May 4, 2008, 4:30:43 PM5/4/08
to
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

unread,
May 5, 2008, 11:29:12 AM5/5/08
to

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.

<mrajani...@gmail.com> wrote in message
news:95c70ff6-2e4c-4707...@e53g2000hsa.googlegroups.com...

0 new messages