H
Homer
Hi,
I'm developing my first ever web application and I'm running into a
lot of problems. My problem I'm encountering now is how to make roles
work when I deploy my web app to my company's server. It's an
Intranet application. I used forms authentication and I enabled the
role manager in the web.config file. I created a folder in the
application root directory and put all the web pages that require
authentication in there. Then I created a web.config file for that
folder like the following:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<authorization>
<deny users="*" />
</authorization>
</system.web>
<location path="HRSearch.aspx">
<system.web>
<authorization>
<allow roles="HumanResourceMember"/>
</authorization>
</system.web>
</location>
<location path="YourInformation.aspx">
<system.web>
<authorization>
<allow roles="User, HumanResourceMember"/>
</authorization>
</system.web>
</location>
</configuration>
the next thing I did was adding roles into the site.sitemap file like
the following:
<siteMapNode url="Default.aspx"
title="Home"
description="Home page">
<siteMapNode title="Personnel Information" roles="*" >
<siteMapNode url="PersonnelInformation/HRSearch.aspx"
title="Personnel Search"
description="This option is only available to HR
staff"
roles="HumanResourceMember" />
<siteMapNode url="PersonnelInformation/YourInformation.aspx"
title="Your Information"
description="Your personal information"
roles="User,HumanResourceMember"/>
</siteMapNode
The roles implementation works on my development machine but when I
deployed the application to my company's IIS server it does not work.
When I login in as a member of the user role, I expect to see the
"Your Information" page. When I login as a member of the
HumanResourceMember, I expect to see the "Personnel Search" page. It
works wonderfully on my XP development machine but neither of the
aforementioned pages show up when I login to it remotely. I don't
even know how to google this problem. Please help me.
Thank you,
Jon
I'm developing my first ever web application and I'm running into a
lot of problems. My problem I'm encountering now is how to make roles
work when I deploy my web app to my company's server. It's an
Intranet application. I used forms authentication and I enabled the
role manager in the web.config file. I created a folder in the
application root directory and put all the web pages that require
authentication in there. Then I created a web.config file for that
folder like the following:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<authorization>
<deny users="*" />
</authorization>
</system.web>
<location path="HRSearch.aspx">
<system.web>
<authorization>
<allow roles="HumanResourceMember"/>
</authorization>
</system.web>
</location>
<location path="YourInformation.aspx">
<system.web>
<authorization>
<allow roles="User, HumanResourceMember"/>
</authorization>
</system.web>
</location>
</configuration>
the next thing I did was adding roles into the site.sitemap file like
the following:
<siteMapNode url="Default.aspx"
title="Home"
description="Home page">
<siteMapNode title="Personnel Information" roles="*" >
<siteMapNode url="PersonnelInformation/HRSearch.aspx"
title="Personnel Search"
description="This option is only available to HR
staff"
roles="HumanResourceMember" />
<siteMapNode url="PersonnelInformation/YourInformation.aspx"
title="Your Information"
description="Your personal information"
roles="User,HumanResourceMember"/>
</siteMapNode
The roles implementation works on my development machine but when I
deployed the application to my company's IIS server it does not work.
When I login in as a member of the user role, I expect to see the
"Your Information" page. When I login as a member of the
HumanResourceMember, I expect to see the "Personnel Search" page. It
works wonderfully on my XP development machine but neither of the
aforementioned pages show up when I login to it remotely. I don't
even know how to google this problem. Please help me.
Thank you,
Jon