Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

how to provide access using Role

Posted on 2007-11-19
3
155 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
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.

860 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