Solved

how to provide access using Role

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
send messages to whatsapp programatically 2 48
Windows Media Player 2 26
C# bracket error 3 31
C# Gridview 1 32
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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 users how to migrate an existing Wordpress website to a new domain.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

773 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