Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: Authentication and user based content

Reply
Thread Tools

Re: Authentication and user based content

 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      04-14-2008
You can use different sitemaps for different roles.

If you have 2 providers in the web.config

<siteMap enabled="true">
<providers>
<add name="Role1SiteMapProvider" description="SiteMap for role 1."
type="System.Web.XmlSiteMapProvider"
siteMapFile="Roles/Role1/Role1.sitemap" />
<add name="Role2SiteMapProvider" description="SiteMap for role 2."
type="System.Web.XmlSiteMapProvider"
siteMapFile="Roles/Role2/Role2.sitemap" />
</providers>
</siteMap>

you can set SiteMapProvider property for navigation controls in the code to
either Role1SiteMapProvider or Role2SiteMapProvider depending on the user
role.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"John Devlon" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed).. .
> Hi,
>
> I've created a small application with some user-authentication and roles.
>
> I would like to show/hide some navigation parts based on the users role.
>
> Could someone please tell me what the best solution is?
>
> Do I have to create different pages for each role and check the users
> role when logged in?
>
> Thanx
>
> Kind regards
>
> John
>



 
Reply With Quote
 
 
 
 
John Devlon
Guest
Posts: n/a
 
      04-14-2008
Thanx for your respons....

However, I think it's not something I can use...

I've created a navigation system with pictures and placed them in a
table....
Only some rows have to be shown with each role...

Can I show/hide elements like tables and pictures depending on the role?

Thanx

John





"Eliyahu Goldin" <(E-Mail Removed)> schreef in
bericht news:(E-Mail Removed)...
> You can use different sitemaps for different roles.
>
> If you have 2 providers in the web.config
>
> <siteMap enabled="true">
> <providers>
> <add name="Role1SiteMapProvider" description="SiteMap for role 1."
> type="System.Web.XmlSiteMapProvider"
> siteMapFile="Roles/Role1/Role1.sitemap" />
> <add name="Role2SiteMapProvider" description="SiteMap for role 2."
> type="System.Web.XmlSiteMapProvider"
> siteMapFile="Roles/Role2/Role2.sitemap" />
> </providers>
> </siteMap>
>
> you can set SiteMapProvider property for navigation controls in the code
> to either Role1SiteMapProvider or Role2SiteMapProvider depending on the
> user role.
>
> --
> Eliyahu Goldin,
> Software Developer
> Microsoft MVP [ASP.NET]
> http://msmvps.com/blogs/egoldin
> http://usableasp.net
>
>
> "John Devlon" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed).. .
>> Hi,
>>
>> I've created a small application with some user-authentication and roles.
>>
>> I would like to show/hide some navigation parts based on the users role.
>>
>> Could someone please tell me what the best solution is?
>>
>> Do I have to create different pages for each role and check the users
>> role when logged in?
>>
>> Thanx
>>
>> Kind regards
>>
>> John
>>

>
>



 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      04-14-2008
You can always check what is the role for the current user and set visual
properties for your controls accordingly.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"John Devlon" <(E-Mail Removed)> wrote in message
news:8jKMj.23578$(E-Mail Removed)2...
> Thanx for your respons....
>
> However, I think it's not something I can use...
>
> I've created a navigation system with pictures and placed them in a
> table....
> Only some rows have to be shown with each role...
>
> Can I show/hide elements like tables and pictures depending on the role?
>
> Thanx
>
> John
>
>
>
>
>
> "Eliyahu Goldin" <(E-Mail Removed)> schreef in
> bericht news:(E-Mail Removed)...
>> You can use different sitemaps for different roles.
>>
>> If you have 2 providers in the web.config
>>
>> <siteMap enabled="true">
>> <providers>
>> <add name="Role1SiteMapProvider" description="SiteMap for role 1."
>> type="System.Web.XmlSiteMapProvider"
>> siteMapFile="Roles/Role1/Role1.sitemap" />
>> <add name="Role2SiteMapProvider" description="SiteMap for role 2."
>> type="System.Web.XmlSiteMapProvider"
>> siteMapFile="Roles/Role2/Role2.sitemap" />
>> </providers>
>> </siteMap>
>>
>> you can set SiteMapProvider property for navigation controls in the code
>> to either Role1SiteMapProvider or Role2SiteMapProvider depending on the
>> user role.
>>
>> --
>> Eliyahu Goldin,
>> Software Developer
>> Microsoft MVP [ASP.NET]
>> http://msmvps.com/blogs/egoldin
>> http://usableasp.net
>>
>>
>> "John Devlon" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed).. .
>>> Hi,
>>>
>>> I've created a small application with some user-authentication and
>>> roles.
>>>
>>> I would like to show/hide some navigation parts based on the users role.
>>>
>>> Could someone please tell me what the best solution is?
>>>
>>> Do I have to create different pages for each role and check the users
>>> role when logged in?
>>>
>>> Thanx
>>>
>>> Kind regards
>>>
>>> John
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error: Only Content controls are allowed directly in a content page that contains Content controls. hazz ASP .Net 6 06-09-2010 01:54 PM
HTTP basic authentication with form-based authentication Max Python 2 08-08-2008 06:16 PM
ASP.NET: How to conditionally display content based on login/authentication? ASP .Net 3 07-26-2005 08:58 PM
Changing Basic Authentication to Form-Based Authentication Dom Java 0 10-18-2004 03:30 PM
From Basic Authentication to Form-Based Authentication Dom Java 0 10-15-2004 09:50 PM



Advertisments