473,322 Members | 1,911 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

setting up roles?

HI I am looking at some C# code that seems to change a display based on user
roles, below is a small part of the code.
public bool IsInQCCRole()
{
return User.IsInRole(this.WebServer + "\\QCC");
}
Anyhow I want to test it and set different role levels and am currently
running the application on localhost. Just wondering if anyone nows how to
set up these roles?
thanks.
--
Paul G
Software engineer.
Nov 19 '05 #1
2 1048
Why are you scoping your roles to the webserver's machine name? Typically
roles are logical users of your system ("Doctor", "Nurse", "Admin") and are
really application level semantics that shouldn't be concerned with the name
of the webserver.

-Brock
DevelopMentor
http://staff.develop.com/ballen
HI I am looking at some C# code that seems to change a display based
on user
roles, below is a small part of the code.
public bool IsInQCCRole()
{
return User.IsInRole(this.WebServer + "\\QCC");
}
Anyhow I want to test it and set different role levels and am
currently
running the application on localhost. Just wondering if anyone nows
how to
set up these roles?
thanks.


Nov 19 '05 #2
Hi thanks for the response. Actually I am looking at a program someone else
wrote that is not working correctly and am trying to debug it. Not sure what
they are doing with the server name. I think they are using windows account
user groups but not sure.
--
Paul G
Software engineer.
"Brock Allen" wrote:
Why are you scoping your roles to the webserver's machine name? Typically
roles are logical users of your system ("Doctor", "Nurse", "Admin") and are
really application level semantics that shouldn't be concerned with the name
of the webserver.

-Brock
DevelopMentor
http://staff.develop.com/ballen
HI I am looking at some C# code that seems to change a display based
on user
roles, below is a small part of the code.
public bool IsInQCCRole()
{
return User.IsInRole(this.WebServer + "\\QCC");
}
Anyhow I want to test it and set different role levels and am
currently
running the application on localhost. Just wondering if anyone nows
how to
set up these roles?
thanks.


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: VB Programmer | last post by:
PLEASE HELP.... I'm having trouble. In my login form after I've verified the username/password are valid I do this: Select Case iMyPrivilege Case 0 Dim arrRoles() As String = {"guest"}...
2
by: Ed | last post by:
Hi I currently have an asp.NET project. I'm using Access 2003 and forms authentication to authenticate users. Can anyone tell me how to set the roles in asp.NET so that it recognizes them? The...
1
by: Mad Scientist Jr | last post by:
I would like to write a vb.asp.net function Private Function fn_sGetRoles(byval sDelimiter as string) As String that simply returns a delimited list of all the roles a user belongs to. I...
5
by: hansiman | last post by:
Following http://aspnet.4guysfromrolla.com/articles/082703-1.aspx I've set up roles authentication for my web application. User's roles are registered by: HttpContext.Current.User = _ New...
9
by: Mike Hofer | last post by:
BACKGROUND: We've designed a Website for a client that will be deployed across multiple physical locations. The site will be hosted from a corporate NOC, and administered by the IT group there. ...
0
by: Douglas J. Badin | last post by:
Hi, The problem with Authorization is it stops at the first match and doesn't permit Grouping. On the Web Site, I am trying to Secure Page Access and SiteNaviagation by implementing the...
4
by: AC | last post by:
Hi there. My asp.net 2.0 development website uses roles to control access to sections of my site, configured using the asp.net configuration tool, which is great. Except that isn't available once...
0
by: sidhuasp | last post by:
Hi everyone I am using a mainmenu witeh sitemap provider with folowing sitemap <siteMapNode> <siteMapNode url="" title="Master Data" description="Enter Master data" roles ="Admin,PM"> ...
5
by: daokfella | last post by:
I have a custom web.config section similar to the following: <CustomAuthSettings attr1="" attr2=""> <Locations RedirectUrl="Invalid.aspx"> <add Path="test.aspx" Roles="1,2,3" Permissions="4,5,6"...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.