Re: Authorization based on roles or directory access?
- From: rmgalante@xxxxxxxxxxxx
- Date: 11 Jan 2007 13:47:00 -0800
And I have one other suggestion.
Your authorization sections in the web.config file can specify a script
as well as a subdirectory.
<location path="Subdirectory">
<system.web>
<authorization>
<allow roles="Power Users"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
<location path="Subdirectory/AdminsAndPowerUsers.aspx">
<system.web>
<authorization>
<allow roles="Admins,Power Users"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
I'm not sure how inconvenient this will be until I get further along in
my development effort.
But the roles attribute in the sitemap works for this authorization
scheme as well.
Rob
Jakob Lithner wrote:
First to make myself clear:
I have several roles but we can simplify the case and list three of them:
- Members
- Editors
- Admins
Theyr are not mutually exclusive, so a user in the Editors role also belongs
to the Members role.
You wrote this:
"For navigation node(treeview node, menu item)'s visibility(whether it can
be displayed to a certain user) on navigation controls, it is controlled by
both the <authorization> setting and the "roles" attribute in
<siteMapNode>. And by default, if you have enabled security trimming in
sitemap provider. e.g. (.....)
and you haven't manually specify any "roles" attribute for the
<siteMapNode> in the web.sitemap file. The visibility of each sitemapnode
is (then?) determined by <authorization> setting."
I would like this to be the case, but this is not what happens.
It would be fine if the <authorization> setting was only checked as an extra
security check for nodes that I in the sitemap decided to show.
Instead it ADDS permission so the node is shown where it shouldn't!
I do specify roles="Editors" on one of my nodes.
But this node is visible even for users that don't belong to this role.
I guess it is because I in the web.config specify <allow roles="Members"/>.
I guess the conclusion is that I need to create 10-15 directories to match
all my roles and specify corresponding sections in each web.config. That is a
lot of double work just to ensure the navigation nodes and the files have
corresponding authorizations.
I am pretty sure most people don't solve it like that.
.
- References:
- RE: Authorization based on roles or directory access?
- From: Steven Cheng[MSFT]
- RE: Authorization based on roles or directory access?
- Prev by Date: Re: Position of dynamically added controls
- Next by Date: Re: Authorization based on roles or directory access?
- Previous by thread: RE: Authorization based on roles or directory access?
- Next by thread: Re: Authorization based on roles or directory access?
- Index(es):
Relevant Pages
|