authorization different paths and roles

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default authorization different paths and roles

    I have this authorization config in my web.config

    <location path="manager">
    <system.web>
    <authorization>
    <deny users="?" />
    <allow roles="admins" />
    </authorization>
    </system.web>
    </location>
    <location path="resourcemgr">
    <system.web>
    <authorization>
    <deny users="?" />
    <allow roles="resourceEditors" />
    </authorization>
    </system.web>
    </location>

    I need to give access to the "manager" dir for the "admins" role and access
    to "resourcemgr" dir for the "resourceEditors" role

    With this config is allowing me to get in the "manager" dir using the
    "resourceEditors", and that couldn't be.

    Am I missing something?

    thanks
    MAtias


    Matias Woloski Guest

  2. Similar Questions and Discussions

    1. Directory paths: roles vs. users
      We have a fairly large site with lots of authors. Most of them will have identical permissions and options, except for the directory they are...
    2. ASP.NET Authorization
      I'd like to use role in Forms authentication and I found the following words from .net SDK about ASP.NET Authorization. " Identifies a targeted...
    3. Options for roles attribute of <authorization>/<allow> tag ...
      I'd like to restrict access to a page to the people in a group that doesn't have a unique name, so domain\group doesn't work. I've gotten it to work...
    4. Bringing paths into Photoshop from AI as PATHS
      What happened to bringing paths into Photoshop from Illustrator as PATHS? Used to be able to copy paths into Photoshop from AI 8 as a path. Can this...
    5. need general help with setting paths & man paths for apps
      On Thu, 10 Jul 2003, solaris newbie wrote: That is one way, but a (perhaps) beter way would be to modify PATH in individual user's .profile. ...
  3. #2

    Default Re: authorization different paths and roles

    <location path="manager"> is this path MANAGER a drirectory in IIS or a
    group?
    Try using <deny> and see if it will go..
    Cheers




    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    naijacoder naijacoder Guest

  4. #3

    Default Re: authorization different paths and roles

    Writing this, it won't allow anyone to get into manager,

    <location path="manager">
    <system.web>
    <authorization>
    <allow roles="admins" />
    <deny users="*" />
    </authorization>
    </system.web>
    </location>

    However, I still cannot make it work to only allow "admins" role.

    any ideas?

    thanks!
    Matias

    "naijacoder naijacoder" <naijacoder@toughguy.net> wrote in message
    news:eRVeRUVjEHA.2524@TK2MSFTNGP11.phx.gbl...
    > <location path="manager"> is this path MANAGER a drirectory in IIS or a
    > group?
    > Try using <deny> and see if it will go..
    > Cheers
    >
    >
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Matias Woloski Guest

  5. #4

    Default Re: authorization different paths and roles

    Hi Matias,

    I assume that you are using Forms Authentication and you are filling the
    roles info with the appropriate data. Otherwise if you use Windows Auth you
    should add the domain info the group name (role). Regarding the first
    scenario, your last config should be fine: (apply the same to the
    'resourcemgr' folder with the 'resourceEditors' role)
    > <location path="manager">
    > <system.web>
    > <authorization>
    > <allow roles="admins" />
    > <deny users="*" />
    > </authorization>
    > </system.web>
    > </location>
    This section may be located in the root web.config file.
    You should have this setting in the system.web main section as well.

    <authorization>
    <deny users="?" />
    </authorization>

    Notice that all users with the 'admins' role inlcuded in it's roles
    collection will be allowed to access the manager folder.


    --
    Hernan de Lahitte
    Lagash Systems S.A.
    [url]http://weblogs.asp.net/hernandl[/url]


    This posting is provided "AS IS" with no warranties, and confers no rights.

    "Matias Woloski" <woloski@NOSPAMsion.com> wrote in message
    news:uazgtXpjEHA.3608@TK2MSFTNGP09.phx.gbl...
    > Writing this, it won't allow anyone to get into manager,
    >
    > <location path="manager">
    > <system.web>
    > <authorization>
    > <allow roles="admins" />
    > <deny users="*" />
    > </authorization>
    > </system.web>
    > </location>
    >
    > However, I still cannot make it work to only allow "admins" role.
    >
    > any ideas?
    >
    > thanks!
    > Matias
    >
    > "naijacoder naijacoder" <naijacoder@toughguy.net> wrote in message
    > news:eRVeRUVjEHA.2524@TK2MSFTNGP11.phx.gbl...
    >> <location path="manager"> is this path MANAGER a drirectory in IIS or a
    >> group?
    >> Try using <deny> and see if it will go..
    >> Cheers
    >>
    >>
    >>
    >>
    >> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    >> Don't just participate in USENET...get rewarded for it!
    >
    >

    Hernan de Lahitte Guest

  6. #5

    Default Re: authorization different paths and roles

    Thanks to everyone.

    It wasn't a config problem. This was a code I inherit from someone :s The
    global.asax was hooked to the AuthenticationRequest event and was getting
    the roles from a cookie and didn't refreshed the db role for the user.

    thanks again,
    Matias
    Soutworks
    [url]http://blogs.southworks.net/matiaswoloski[/url]


    "Hernan de Lahitte" <hernan@lagash.com> wrote in message
    news:#$zBUorjEHA.3664@TK2MSFTNGP11.phx.gbl...
    > Hi Matias,
    >
    > I assume that you are using Forms Authentication and you are filling the
    > roles info with the appropriate data. Otherwise if you use Windows Auth
    you
    > should add the domain info the group name (role). Regarding the first
    > scenario, your last config should be fine: (apply the same to the
    > 'resourcemgr' folder with the 'resourceEditors' role)
    >
    > > <location path="manager">
    > > <system.web>
    > > <authorization>
    > > <allow roles="admins" />
    > > <deny users="*" />
    > > </authorization>
    > > </system.web>
    > > </location>
    >
    > This section may be located in the root web.config file.
    > You should have this setting in the system.web main section as well.
    >
    > <authorization>
    > <deny users="?" />
    > </authorization>
    >
    > Notice that all users with the 'admins' role inlcuded in it's roles
    > collection will be allowed to access the manager folder.
    >
    >
    > --
    > Hernan de Lahitte
    > Lagash Systems S.A.
    > [url]http://weblogs.asp.net/hernandl[/url]
    >
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    rights.
    >
    > "Matias Woloski" <woloski@NOSPAMsion.com> wrote in message
    > news:uazgtXpjEHA.3608@TK2MSFTNGP09.phx.gbl...
    > > Writing this, it won't allow anyone to get into manager,
    > >
    > > <location path="manager">
    > > <system.web>
    > > <authorization>
    > > <allow roles="admins" />
    > > <deny users="*" />
    > > </authorization>
    > > </system.web>
    > > </location>
    > >
    > > However, I still cannot make it work to only allow "admins" role.
    > >
    > > any ideas?
    > >
    > > thanks!
    > > Matias
    > >
    > > "naijacoder naijacoder" <naijacoder@toughguy.net> wrote in message
    > > news:eRVeRUVjEHA.2524@TK2MSFTNGP11.phx.gbl...
    > >> <location path="manager"> is this path MANAGER a drirectory in IIS or a
    > >> group?
    > >> Try using <deny> and see if it will go..
    > >> Cheers
    > >>
    > >>
    > >>
    > >>
    > >> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > >> Don't just participate in USENET...get rewarded for it!
    > >
    > >
    >
    >

    Matias Woloski Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139