dynamic URL authorization with web.config?
-
Hi all. I was wondering how to dynamicly change the web.config file to allow or deny users of a website. Here i'm thinking of the:
<[allow|deny] users roles verbs />
The reason for wanting to do this, is that i have coded a CMS System, and i want to give the administrator the possibility of making the website private while constructing content. Does anyone know how to do this? Regards Christian -
Hi all. I was wondering how to dynamicly change the web.config file to allow or deny users of a website. Here i'm thinking of the:
<[allow|deny] users roles verbs />
The reason for wanting to do this, is that i have coded a CMS System, and i want to give the administrator the possibility of making the website private while constructing content. Does anyone know how to do this? Regards Christian -
Here is the basic web.config settings: Where path is pointing to a subfolder in your website. Or you can point to "." for the whole web site. Hope that helps. Ben
Hi Ben First off, i'd like to thank you for trying to help me out with my problem. I am not sure if i made it clear enough what i want to do. I know how to create an entry in the web.config, as you showed in your reply. What i want to do is to edit it "on-the-fly" from a web administration. e.g., ticking a checkbox should make it say and ticking it again, make it: i hope that i have maded myself more clear now, and hope that yout can help? -- Christian
-
Hi Ben First off, i'd like to thank you for trying to help me out with my problem. I am not sure if i made it clear enough what i want to do. I know how to create an entry in the web.config, as you showed in your reply. What i want to do is to edit it "on-the-fly" from a web administration. e.g., ticking a checkbox should make it say and ticking it again, make it: i hope that i have maded myself more clear now, and hope that yout can help? -- Christian
Use the IIS manager?
only two letters away from being an asset
-
Hi Ben First off, i'd like to thank you for trying to help me out with my problem. I am not sure if i made it clear enough what i want to do. I know how to create an entry in the web.config, as you showed in your reply. What i want to do is to edit it "on-the-fly" from a web administration. e.g., ticking a checkbox should make it say and ticking it again, make it: i hope that i have maded myself more clear now, and hope that yout can help? -- Christian
If your web site is .net 2.0 there are some things that you can do with a web.config. The downside is the work it takes to get the web.config to reload and see your changes and the fact that re-loading the web.config will re-start the site which will affect everyone currently logged in. I would say your time is probably better spent elsewhere and either manually change the config file or use iis manager. Ben
-
If your web site is .net 2.0 there are some things that you can do with a web.config. The downside is the work it takes to get the web.config to reload and see your changes and the fact that re-loading the web.config will re-start the site which will affect everyone currently logged in. I would say your time is probably better spent elsewhere and either manually change the config file or use iis manager. Ben
thx alot for the reply ... both of you. One problem for me is that the website is in a hosted enviroment so i don't have the possibility of altering the ISS. I do know that changing the web.config will restart the application, and that is a sideeffect that i can live with. Then its up to the end-user to make the change at a suitable time. But i am still very much interested in a solution? -- Christian