views:

1463

answers:

2

hi Everyone,

I am trying to setup roles in a dynamic data website.. the problem is that i cant set it by simpy doing this.

  <location path="List.aspx">
    <system.web>
      <authorization>
        <allow roles="Administrators" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>

so even when i login as a role called "Member" it still alows me to go into List.aspx

can any one please guide me on this..

oh btw i am also using mvc on the same site

A: 

Your question as my friend said , needs more details , anyway

  1. at first try to check whether you enabled Roles inside web.config or not .

  2. Have you done this by WAT or not ? Try the alternative as a test .

3 . Set the authentication inside web.config to Forms . hope to help Regards -MHM-

Sypress
+4  A: 

Dynamic Data pages ignores all that jazz.

Look at the Secure Dynamic Data Project here:

http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=14473

...

Or there is another way which worked for me.

Change your location path to:

  <location path="Admin/<TableName>/List.aspx">
    <system.web>
      <authorization>
        <allow roles="Administrators" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>

And then (in your global.asax.cs file) change your dynamic data route to:

routes.Add(new DynamicDataRoute("Admin/{table}/{action}.aspx")

This allowed me to provide table level security. If that doesn't work just make a comment and I'll look into again.

Merritt