473,395 Members | 1,368 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,395 software developers and data experts.

read web.config users authorized for a cerrtain path

Dan
hi ng,

i'd like to add control elements on a page, but only for users that are
authotized to access a certain location, defined in web.config.
my question:
is it possible to read the <allow users="" /> section of a <location> in
web.config, or do i have to add these users as key-value elements that
can be accessed by AppSetting... ?
i didn't find another solution, but that way is very unconfortable in a
environment with many users.

thanks very much in advance for your help.

dan
Nov 19 '05 #1
3 1515
Dan,

allow users only allow users to access the application, so you can put
conditional code to check for those users using User.Identity.Name and read
those user preferences through Appsettings element.

Let me know if you need anything else.

regards
Joyjit

"Dan" <da**********@zdv.uni-tuebingen.de> wrote in message
news:ct**********@newsserv.zdv.uni-tuebingen.de...
hi ng,

i'd like to add control elements on a page, but only for users that are
authotized to access a certain location, defined in web.config.
my question:
is it possible to read the <allow users="" /> section of a <location> in
web.config, or do i have to add these users as key-value elements that
can be accessed by AppSetting... ?
i didn't find another solution, but that way is very unconfortable in a
environment with many users.

thanks very much in advance for your help.

dan

Nov 19 '05 #2
Dan
hi joyjit,

thanks for your help.
i wanted to avoid to add the users that are allowed to access a certain
location twice: to the
<location path="path"> <system.web> section AND
to the appsettings.
the control elements lead to the restricted area, so only users allowed
to go there shall see the elements (buttons).
so, can i check User.Identity.Name against a location section in web.config?

regards,
daniel
Joyjit Mukherjee wrote:
Dan,

allow users only allow users to access the application, so you can put
conditional code to check for those users using User.Identity.Name and read
those user preferences through Appsettings element.

Let me know if you need anything else.

regards
Joyjit

"Dan" <da**********@zdv.uni-tuebingen.de> wrote in message
news:ct**********@newsserv.zdv.uni-tuebingen.de...
hi ng,

i'd like to add control elements on a page, but only for users that are
authotized to access a certain location, defined in web.config.
my question:
is it possible to read the <allow users="" /> section of a <location> in
web.config, or do i have to add these users as key-value elements that
can be accessed by AppSetting... ?
i didn't find another solution, but that way is very unconfortable in a
environment with many users.

thanks very much in advance for your help.

dan


Nov 19 '05 #3
Zen
if you want to modify the path or users item-value on fly, there're 2 tool
class to change the web.config at runtime:
www.aspsimply.com/vbnet/ProTool.aspx
www.aspsimply.com/cs/CSTool.aspx
kind regards


"Dan" <da**********@zdv.uni-tuebingen.de> wrote in message
news:ct**********@newsserv.zdv.uni-tuebingen.de...
hi joyjit,

thanks for your help.
i wanted to avoid to add the users that are allowed to access a certain
location twice: to the
<location path="path"> <system.web> section AND
to the appsettings.
the control elements lead to the restricted area, so only users allowed to
go there shall see the elements (buttons).
so, can i check User.Identity.Name against a location section in
web.config?

regards,
daniel
Joyjit Mukherjee wrote:
Dan,

allow users only allow users to access the application, so you can put
conditional code to check for those users using User.Identity.Name and
read
those user preferences through Appsettings element.

Let me know if you need anything else.

regards
Joyjit

"Dan" <da**********@zdv.uni-tuebingen.de> wrote in message
news:ct**********@newsserv.zdv.uni-tuebingen.de...
hi ng,

i'd like to add control elements on a page, but only for users that are
authotized to access a certain location, defined in web.config.
my question:
is it possible to read the <allow users="" /> section of a <location> in
web.config, or do i have to add these users as key-value elements that
can be accessed by AppSetting... ?
i didn't find another solution, but that way is very unconfortable in a
environment with many users.

thanks very much in advance for your help.

dan



Nov 19 '05 #4

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

Similar topics

2
by: darkelf | last post by:
Hello, I have a site that uses windows authentication and I demand credentials for files inside a specific folder. (through web.config). My problem is that when I try to read something from my...
1
by: Shock | last post by:
I am interesting in figuring out how to use the PhysicalApplicationPath method or another equivalent method inside of the Web.Config file. I have a key in my appsettings that looks something like...
3
by: Wm. Scott Miller | last post by:
What is the difference between using a username and password in the processmodel section vs using one in impersonation in the machine.config file? What are the advantages of each and what are the...
0
by: tma | last post by:
I'm attempting to do Forms authentication in my web.config but I'm having a bit of difficulty. My web config looks like the following: <location...
9
by: Benny Ng | last post by:
Hi,all, How to let the sub-directory to avoid the authentication control from Root's webconfig? I heard that we can add a new web.config to the sub-directory. And then we can slove the problem....
5
by: Andrew | last post by:
Hi, I have a default.aspx which allows the user to choose between module Admin and module B. When the user clicks either one, he will be redirected to a FormsAuthentication login page. The...
6
by: David++ | last post by:
Hi folks, So I have implemented a Web service which provides several Web Methods. Before the client can use the WebMethods they must first be authenticated and authorized i.e. they login, obtain...
10
by: =?Utf-8?B?U3RlZmFuIEJhcmxvdw==?= | last post by:
This has been working perfectly for months. Since we switched from ASP.NET 1.1 to 2.0, we have constant and sporadic issues with updating our applications. Touching the web.config works about...
1
by: scottw512 | last post by:
Hi, We have roles defined in web.config and have setup our roles system where we can use User.IsInRole. The problem is that when a page fails a role check, ASP.NET redirects it to the Forms...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.