Solved

how to provide access using Role

Posted on 2007-11-19
3
152 Views
Last Modified: 2010-04-15
Hello,

I have written roles for the Users in my application through Database, where I want them to access all page's.But can user with certain Role can edit certain pages.

Any answers will be greatly appreciated.
This is  ASP.NET 1.1 using c#.

Thanks
0
Comment
Question by:CoinsDrop
  • 2
3 Comments
 
LVL 14

Expert Comment

by:dfu23
ID: 20314745
If you need some reference material then here are some links:

http://support.microsoft.com/kb/306590
http://www.4guysfromrolla.com/webtech/121901-1.shtml
http://msdn2.microsoft.com/en-us/library/microsoft.visualbasic.applicationservices.user.isinrole.aspx

But basically, your should be able to limit either access to pages or just what they see by getting a true/false back from the User.IsInRole() function.
0
 

Author Comment

by:CoinsDrop
ID: 20315097
Here , I need all the user has View access, but only particular people with having certain roles can have  (edit,or delete).
I have checked the above links, but still not clear.

Thanks
0
 
LVL 14

Accepted Solution

by:
dfu23 earned 500 total points
ID: 20315188
So, a quick C# example might be along these lines:

if (User.IsInRole("Administrator"))

{

    btnEdit.Visible = true;

    btnDelete.Visible = true;

}

else

{

    btnEdit.Visible = false;

    btnDelete.Visible = false;

}

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MVC5 Dataformat String for Phone not working 3 25
VB.Net How to Exit Sub - Exit Form??? 5 48
Export import database 4 41
What .NET URL re-routing tool did I use? 2 36
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now