Dynamic gridview content based on user role?

T

Troy Dot Net

I have a page that displays SQL Server tables via GridView controls.
However, some of the table fields (gridview columns) should be visibile only
to specific users (Admin, Supervisors, etc) and some should be
visible/editable only by specific users (Admin). I would like a simple,
robust method of dynamically enabling/disabling content based on the user's
role. I'm using ASP.Net 2.0/C# within VS2005TS and SQL Server 2000 (can also
use 2005 express).

Any suggestions? Thanks for your advice.

Troy
 
M

MikeS

Will something like this work?
<control enabled='<%=Roles.IsCallerInRole("Admin")%>'>
 
T

Troy Dot Net

Will something like this work?
<control enabled='<%=Roles.IsCallerInRole("Admin")%>'>

I believe that will work, though that's the easy part. The hurdle is how to
define which controls require which role(s) to be viewable and which controls
require which role(s) to be editable (and maybe again for deleteable).
Making this system scaleable, foolproof and manageable is the hard part.

Thanks for the lead.

Troy
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top