Solved

how to provide access using Role

Posted on 2007-11-19
3
151 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
This video teaches users how to migrate an existing Wordpress website to a new domain.

762 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

19 Experts available now in Live!

Get 1:1 Help Now