1

I am new in MVC. I want to restrict my img folder role wise but:

I don't know how to create custom role. So please guide me on how I mange Custom Role Management?

 web.config
 <location path="img" allowOverride="false">
    <system.web>
      <authorization lockItem="true">
        <allow roles="member"/>
        <deny users="*" />
      </authorization>
    </system.web>
  </location>

I have provided above code in web.config file.

<authentication mode="Forms">
  <forms name="SiteUser" path="~" loginUrl="~/Login/Login"  protection="All" timeout="30"/>
</authentication>

When I try in URL location http://localhost:51116/img it automatically redirects me on login page but when I write http://localhost:51116/img/1-1.png at that time I can access my file.

I want to restrict that folder and file inside that folder role wise.

Please help me.

rbashish
  • 2,073
  • 2
  • 24
  • 35
Shah NIral
  • 420
  • 5
  • 15
  • http://stackoverflow.com/questions/11048863/modules-runallmanagedmodulesforallrequests-true-meaning is answer to one of immediate problems you have, but the way you asked question is way too broad (and may get close votes for asking for tutorial). – Alexei Levenkov Jan 20 '16 at 07:35

0 Answers0