Click here to Skip to main content
15,891,856 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Role-base security is not working at server it is working fine at local pc but not working at server after deploy
the code is


HTML
<configuration>
    
  <system.web>
    <authentication mode="Forms">
      <forms name="abc"
          loginUrl="Error.aspx"
          protection="All"
          path="/"/>
    </authentication>
    <authorization>
      <allow users="*" />
    </authorization>
  </system.web>
  
  
  <location path="Admin">
    <system.web>
      <authorization>
        <allow roles="Admin" />

        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="Container">
    <system.web>
      <authorization>
        <allow roles="Container" />
        <allow roles="Admin" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="contract">
    <system.web>
      <authorization>
        <allow roles="Contract" />
        <allow roles="Admin" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="Invoice">
    <system.web>
      <authorization>
        <allow roles="Invoice" />
        <allow roles="Admin" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="Order">
    <system.web>
      <authorization>
        <allow roles="Order" />
        <allow roles="Admin" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="Paking_List">
    <system.web>
      <authorization>
        <allow roles="Packing List" />
        <allow roles="Admin" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="Payment">
    <system.web>
      <authorization>
        <allow roles="Payment" />
        <allow roles="Admin" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="Performa_Invoice">
    <system.web>
      <authorization>
        <allow roles="Performa Invoice" />
        <allow roles="Admin" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="Quotation">
    <system.web>
      <authorization>
        <allow roles="Quotation" />
        <allow roles="Admin" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="Supplier">
    <system.web>
      <authorization>
        <allow roles="Supplier" />
        <allow roles="Admin" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
  <location path="Catalog">
    <system.web>
      <authorization>
        <allow roles="Catalog" />
        <allow roles="Admin" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
 
</configuration>


please help me
Posted
Updated 11-Feb-12 0:55am
v3
Comments
Tech Code Freak 11-Feb-12 6:56am    
added pre tags

1 solution

You might have a windows authentication in your project...
If yes then try changing your authentication Mode..
Or if you are not having Window authentication then try to enforce a web.config file in the folders of each roles and use this coding in that..
It will work 100% Because I had the same problem..

<pre lang="HTML"><authorization>
<allow role="admin"/>
<deny role="client"/>
</authorization></pre>
 
Share this answer
 
Comments
Mangal Deep Gupta 22-Apr-13 3:25am    
how u manage it from your login page can u give me code .coz i am also searching exactly that so please help me ...mangalgupta.4321@gmail.com id my mail id

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900