Solved

how to provide access using Role

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…
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.

713 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