beginner's question - sitemaps and roles - how do I let the sitemap know the user role?

This might be a beginner's question but I can't find any examples.  I have a sitemap with roles.  I have existing custom login code.  I know the users role from the database once they log in.  How do I let the sitemap know this user is a particular role?  Is there a property to set?  

I have added the "securityTrimmingEnabled" to the web.config.  All the examples I find are using the 2.0 security that is built in.

sample sitemap:

<?

xml version="1.0" encoding="utf-8" ?>

<

siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >

<

siteMapNode url="" title="Root" description="">

<

siteMapNode title="Dashboard" description="Dashboard" roles="2884, 3102" >

<

siteMapNode title="Population (Active)" description="Population (Active)" roles="2884, 3102" >

</

siteMapNode>

</

siteMapNode>

</

siteMap>

thanks, jessica


Thanks, Jessica
0
LSUgirl
2/5/2007 3:11:22 PM
asp.net.security 27051 articles. 1 followers. Follow

6 Replies
867 Views

Similar Articles

[PageSpeed] 3

This talks about roles and the sitemap control.

http://msdn2.microsoft.com/en-us/library/aa479033.aspx 


Buddy Lindsey
Personal Blog http://www.buddylindsey.com/Blog/
Technology Site and Blog - Beginnermediate
0
percent20
2/5/2007 4:07:12 PM

I know how to create the sitemap with roles and the sitemap provider.  And I know the role of the user logging into the system.  How do I get the sitemap to know the role of the logged in user?  After reading some more, I assume it might be some type of Role Provider that needs to be overriden.

 example:  User has a role of 2884

<

siteMapNode title="Population (Active)" description="Population (Active)" roles="2884, 3102" >
Thanks, Jessica
0
LSUgirl
2/5/2007 4:35:38 PM
from my reading it should just automatically work.  I'll continue reading, but I think it is supposed to just work.  This is totally confusing i can see your frustration.
Buddy Lindsey
Personal Blog http://www.buddylindsey.com/Blog/
Technology Site and Blog - Beginnermediate
0
percent20
2/5/2007 5:18:16 PM

http://msdn2.microsoft.com/en-us/library/ms178428(VS.80).aspx

After reading that it will not only trim that data that you have but everything under that node to.  If you are using your code above you haven't Closed one of your sitemap nodes.  here just copy paste this.

 
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > 
<siteMapNode url="" title="Root" description=""> 
<siteMapNode title="Dashboard" description="Dashboard" roles="2884, 3102" > 
<siteMapNode title="Population (Active)" description="Population (Active)" roles="2884, 3102" > 
</siteMapNode> 
</siteMapNode>
</siteMapNode>
</siteMap> 
 I'll keep reading to see what I can figure out though.
Buddy Lindsey
Personal Blog http://www.buddylindsey.com/Blog/
Technology Site and Blog - Beginnermediate
0
percent20
2/5/2007 5:50:29 PM
LSUgirl:
 

example:  User has a role of 2884

<

siteMapNode title="Population (Active)" description="Population (Active)" roles="2884, 3102" >

Hi,

Do you want to know which role the user currently under. In your example, both 2884, 3102 roles can access node, but it didn't say which is the current role? is it? 

 


Zhao Ji Ma
Sincerely,
Microsoft Online Community Support

“Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
0
Zhao
2/7/2007 5:42:51 AM

I know the current role based on existing login code I had written.  We have some custom code that gets this information when the user logs in and stores it for later use.

After a lot of trial and error, I created my own Role Provider and overwrote most of the functions.  I can send you the example of the code if you want it.

eubanks.jessica@jobcorps.org

 Thanks, jessica


Thanks, Jessica
0
LSUgirl
2/7/2007 9:16:48 PM
Reply:

Similar Artilces:

Login controls
HiI'm building a web app in visual studio 2005 and I'm setting up a 'create user' page for the admin part of the app. I'm creating a customised CreateUserWizard so that I can add a user to the asp.net membership list (in database on my server) and also add some info to one of my tables (user first name, faculty they work for etc).  I want to be able to let the admin user allocate roles (those already defined in my config) from a drop down list. I want to inculde this in my create user wizard, and have an 'update user' section where I can change their role the...

'Roles' is an ambiguous reference between 'System.Web.Security.Roles'
Compilation error? Error 6 'Roles' is an ambiguous reference between 'System.Web.Security.Roles' and 'CuprykForums.Components.Roles' C:\inetpub\wwwroot\CuprykServer\Components\HttpModule\ForumsHttpModule.cs 187 21 Thank you! In ForumsHttpModule.cs (a third party component of your site I gather) you must find all references to the "Roles" class and make sure you prefix it with the full namespace name of the class. There is a roles class in the CSK also, and the compiler is unable to determine if you are refering to the CSK's role class, or the CuprykForum's role class.Step...

Roles, roles, roles
Hey is it posible o have a role for a user to only update the content? I don't want that user to change skins or to make other admin changes... up I think if you allow a role to edit contents on a module level he wont be able to change anything else. Did you try that? cheers, erikErik van Ballegoij, The Netherlands if you allow a role to edit contents in a module lets say discussions module, then that role will be able to edit, delete the threads. so for a role to be able to add new thread only, do we need to write our own code?-keeara g------------------ keeara, see...

Manage Users For This Role / Manage Roles For This User Question
In the roles/user management pages there is a link called Manage Users For This Role and Manage Roles For This User respectively. I want non Admins to be able to see these pages, and currently I have it so that they can see the manage users and manage roles pages. However, when a non admin clicks on Manage Users For This Role or Manage Roles For This User link it does not display the control, just an empty page. I can get around this by giving edit rights to the page, but I do not want them to have edit rights for the page. Any ideas? Thanks  ...

Creating User Account Without Default Security Role (Registered User Role)
  My DNN version is 3.1.1. The portal is set to Private Registration. Unauthenicated users have access to the basic pages of the site. We require my company's current customers to register and be approved to have access to all other pages that contain information restricted to them (the major part of the site). As you know, authorizing a user account applys the Registered User security role by default and this is how I control access to the customer areas.  We want to create a page that will be used by Marketing to allow potential customers by login to...

Problem : Get a list of user belonged to a role or to know if a user already has a role
What code can I write to know if a user belonged to a Role already ? and How can I get a list of a  user already in an existing role ? Please have a look at my code below : Protected Sub AddUsers_OnClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAddUsersToRole.Click' I wanna add some code here to check if a user already belonged to a Role' Please insert your code here. Thanks a lot. ' A role must be selected If RolesListBox.SelectedItem Is Nothing Then Msg.Text = "Please select a role." Exit Sub End If ...

Role management and Authentication questions / Quering data based on user's log in information
I am developing a web site which will consist of the following components: * FlexChart (Flash application) * WebService to pass data to the FlexChart in XML format. * Role management (I may use the build in database of .net for role/management security) * Database structure which will be quiried by the web service.  I need some serious help and here are the questions I have on how to make it work.  When a user logs in to the web site I need to determine what role he/she belongs to and take his cridential to call the right method on the webservice to query the right data fo...

DNN 3.0.5
Dear DNN Community, How do you locate every Security Role associated with a User Account? One would think that you can find out Role Memberships simply by viewing the particular User Account that you are interested in and having a list presented to you of all roles they participate in. Unfortunately, this appears to not be the case. From what I can tell, you can only veiew Security Role membership by clicking every Security Role group and looking. Isn't this a bit tedious for those of who have DNN sites with 100+ security roles? Why not display the Security Roles when viewing the...

Error 15405: Cannot use the resered user or role name 'sa' HELP ANY DBA's Out there
Hi Here we go another problem I have come across. I',m sure this is a simple for the SQL DBA guru's out there. OS = Win2003 Enterprise Edition SP1SQL = SQL2k SP4Problem:I have created another user called "UserOne" and have provided all the database roles and added access to all the DB that I have. Now for security (Maybe I'm wrong here) I want to at least remove all server roles for the user "SA" and remove DB access to all DB's for login "SA". However when doing this task in Enterprise Mgr I get the follwoing error code:Microsoft SQL - DMO (ODBC SQL State: 4200)Error 15405: Cannot use the r...

superreview requested: [Bug 344505] role="anything" on <table> should remove roleless <td>'s, <th's> from hierarchy : [Attachment 229522] Any role on a table means the table structure descendants are
Aaron Leventhal <aaronleventhal@moonset.net> has asked for superreview: Bug 344505: role="anything" on <table> should remove roleless <td>'s, <th's> from hierarchy https://bugzilla.mozilla.org/show_bug.cgi?id=344505 Attachment 229522: Any role on a table means the table structure descendants are no longer structurally relevant, unless they have their own role. They're being used to layout the container. https://bugzilla.mozilla.org/attachment.cgi?id=229522&action=edit ...

superreview cancelled: [Bug 344505] role="anything" on <table> should remove roleless <td>'s, <th's> from hierarchy : [Attachment 229522] Any role on a table means the table structure descendants are
Aaron Leventhal <aaronleventhal@moonset.net> has cancelled Aaron Leventhal <aaronleventhal@moonset.net>'s request for superreview: Bug 344505: role="anything" on <table> should remove roleless <td>'s, <th's> from hierarchy https://bugzilla.mozilla.org/show_bug.cgi?id=344505 Attachment 229522: Any role on a table means the table structure descendants are no longer structurally relevant, unless they have their own role. They're being used to layout the container. https://bugzilla.mozilla.org/attachment.cgi?id=229522&action=edi...

Roles as 'members' of roles?
I was just administering a site and realized how much easier it would be to admin if i could add roles as members of roles. Background: i manage a site for a sports organization run by an executive board. These folks come and go. I currently have them sign up as themselves rather than as the exec member role they play. If i could create a few high-level roles that then become members of more base roles, then when i add a new exec member to the base roles, then automatically get the higher-level functions.Has this been tossed around before? thanks, drew.. It is listed on the ...

user's role
Hi all.How do I ask if the current user role = administratore.g. if user.role="admin" thendo thisend if VB code please....... :)Guy for example, using Windows authentication, you'd do it likeIf User.IsInRole ( "BUILTIN\\Administrators" ) Then   ' do something amusing here EndIfReynald V. Nuñezaspxtreme...

The VM in development
I know the PB VM is used at run time to interpret the p-code and basically is the heart of PowerBuilder, but what is it's role at design/development time? When you create PBDs, does the PB VM have a hand in it? Does the VM have any effect on the IDE? I've noticed that upgrading the VM also seems to upgrade the IDE (e.g. the "disappearing extend ancestor" error). The ultimate question is really this: if I compile a PBD using PB VM Build x, might I run into problems if I run that PBD on Build x + z? If the PBVM is involved in p-code generation, then the answer t...

Creating a "user's page"
I would like to create a page in my intranet portal that would be for each specific user, sort of a personalized home page where they could add content and modules and order them according to their liking. I thought that I could just add a new tab for each user under the home tab and give them admin access to it, but I want it only available to them (ie. the user can only access the tab with their name on it: username = tabname). The only way I can figure out how to do this is to create a role for each user and then limit their tab to their role. However, I have too many users to crea...

Web resources about - beginner's question - sitemaps and roles - how do I let the sitemap know the user role? - asp.net.security

Resources last updated: 1/22/2016 4:17:34 AM