Hey,
I am trying to setup my application so only users with particular roles can see navigation items that match there role. (such as admin can see the admin navigation items)
Well my problem is it's not working and i have checked several sites and found nothing. If anyone could help i would really appreciate it.
This is my code for my Web.Sitemap - <?xml version="1.0" encoding="utf-8" ?>
-
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
-
-
<siteMapNode url="" title="Admin" description="" SecurityTrimmingEnabled="true">
-
-
<siteMapNode url="~/Admin/Default.aspx" title="Admin" description="Admin" roles="*"/>
-
<siteMapNode url="~/Admin/Document.aspx" title="Document" description="" roles="Level 1 User" />
-
<siteMapNode url="~/Admin/DocumentGroup.aspx" title="Document Group" description="" roles="Level 1 User" />
-
<siteMapNode url="~/Admin/DocumentGroupDocument.aspx" title="Document Group Document" description="" roles="Level 1 User"/>
-
<siteMapNode url="~/Admin/DocumentGroupUser.aspx" title="Document Group User" description=""/>
-
<siteMapNode url="~/Admin/DocumentRevision.aspx" title="Document Revision" description=""/>
-
<siteMapNode url="~/Admin/DocumentSource.aspx" title="Document Source" description=""/>
-
<siteMapNode url="~/Admin/DocumentViewHistory.aspx" title="Document View History" description=""/>
-
<siteMapNode url="~/Admin/Request.aspx" title="Request" description=""/>
-
<siteMapNode url="~/Admin/RequestStatus.aspx" title="Request Status" description=""/>
-
<siteMapNode url="~/Admin/User.aspx" title="User" description="" />
-
<siteMapNode url="~/Admin/UserLevel.aspx" title="User Level" description=""/>
-
<siteMapNode url="~/Admin/Watermark.aspx" title="Watermark" description=""/>
-
<siteMapNode url="DocumentList.aspx" title="Document List" description=""/>
-
-
</siteMapNode>
-
</siteMap>
Web.Config - <?xml version="1.0"?>
-
<configuration>
-
-
-
<configSections>
-
-
-
<section name="DMS.Data" type="DMS.Data.Bases.NetTiersServiceSection, DMS.Data" allowDefinition="MachineToApplication" restartOnExternalChanges="true" />
-
<section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
-
</configSections>
-
<appSettings/>
-
<connectionStrings>
-
-
<add name="DMS.Data.ConnectionString" connectionString="Data Source=CORY-LAPTOP\DB1;Initial Catalog=DMS;Integrated Security=true" />
-
<add name="ASPNETDB" connectionString="Data Source=CORY-LAPTOP\DB1;Integrated Security=SSPI;Database=DMS"/>
-
</connectionStrings>
-
<DMS.Data defaultProvider="SqlNetTiersProvider">
-
<providers>
-
<!--
-
*** SqlClient Provider ***
-
connectionStringName: sqlclient connection string to the db
-
useStoredProcedure: if true, indicates that we use the stored procedures, otherwise, we use parametrized queries that are embedded.
-
-->
-
-
<add
-
name="SqlNetTiersProvider"
-
type="DMS.Data.SqlClient.SqlNetTiersProvider, DMS.Data.SqlClient"
-
connectionStringName="DMS.Data.ConnectionString"
-
providerInvariantName="System.Data.SqlClient"
-
entityFactoryType="DMS.Entities.EntityFactory"
-
useEntityFactory="true"
-
enableEntityTracking="true"
-
enableMethodAuthorization="false"
-
useStoredProcedure="false"
-
defaultCommandTimeout="30"
-
/>
-
<!--
-
*** WebserviceClient Provider ***
-
The url parameter indicates the webservices url (ex: http://localhost/DMS/DMSServices.aspx)
-
<add
-
name="WsNetTiersProvider"
-
type="DMS.Data.WebServiceClient.WsNetTiersProvider, DMS.Data.WebServiceClient"
-
url="/DMSServices.asmx" />
-
-->
-
</providers>
-
</DMS.Data>
-
<system.web>
-
<siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
-
<providers>
-
<add name="XmlSiteMapProvider"
-
description="Default SiteMap provider."
-
type="System.Web.XmlSiteMapProvider"
-
siteMapFile="Web.SiteMap"
-
securityTrimmingEnabled="true" />
-
</providers>
-
</siteMap>
-
-
<pages theme="default">
-
<controls>
-
<add tagPrefix="data" namespace="DMS.Web.Data" assembly="DMS.Web"/>
-
<add tagPrefix="data" namespace="DMS.Web.UI" assembly="DMS.Web"/>
-
</controls>
-
</pages>
-
<httpModules>
-
<add name="EntityTransactionModule" type="DMS.Web.Data.EntityTransactionModule, DMS.Web"/>
-
</httpModules>
-
<compilation debug="true" />
-
<authentication mode="Forms">
-
<forms name=".ASPXAUTH"
-
loginUrl="Login.aspx"
-
protection="All"
-
timeout="30"
-
path="/"
-
requireSSL="false"
-
slidingExpiration="true"
-
defaultUrl="Login.aspx"
-
cookieless="UseDeviceProfile"
-
enableCrossAppRedirects="false"/>
-
-
</authentication>
-
<authorization>
-
-
<allow roles="Level 1 User"/>
-
<allow roles="Level 2 User"/>
-
<allow roles="Level 3 User"/>
-
<allow roles="Administrator"/>
-
<deny users="*"/>
-
-
</authorization>
-
<membership defaultProvider="DmsMembershipSqlProvider" userIsOnlineTimeWindow="15">
-
<providers>
-
<add
-
name="DmsMembershipSqlProvider"
-
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
-
connectionStringName="ASPNETDB"
-
enablePasswordRetrieval="false"
-
enablePasswordReset="true"
-
requiresQuestionAndAnswer="true"
-
applicationName="DMS"
-
requiresUniqueEmail="true"
-
passwordFormat="Hashed"/>
-
</providers>
-
</membership>
-
-
<roleManager
-
enabled="true"
-
cacheRolesInCookie="true"
-
defaultProvider="DmsRoleManagerSqlProvider"
-
cookieName=".ASPXROLES"
-
cookiePath="/"
-
cookieTimeout="30"
-
cookieRequireSSL="false"
-
cookieSlidingExpiration="true"
-
createPersistentCookie="false"
-
cookieProtection="All">
-
<providers>
-
<add name="DmsRoleManagerSqlProvider"
-
type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
-
connectionStringName="ASPNETDB"
-
applicationName="DMS"/>
-
</providers>
-
</roleManager>
-
</system.web>
-
<enterpriseLibrary.ConfigurationSource selectedSource="File Configuration Source">
-
<sources>
-
<add name="File Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
-
filePath="entlib.config" />
-
</sources>
-
</enterpriseLibrary.ConfigurationSource>
-
-
-
</configuration>
At the moment this brings up nothing even if you are logged in as a user under level 1 user. If i remove the part in Web.Config that's in bold all users can see all menus.
Also if i try to access an admin page with a basic user it prompts me to login, (not really sure if that helps)
Thanks heaps
1 2388
I feel like an idiot LOL!, after hours and hours of thinking i finnally figured out the parrent needs the role set!!
Thanks anyhow
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Simon |
last post by:
Hi there.
I seem to be a flurry of questions here recently, thanks for you help all,
but ... got another question here.
I am storing URL in a database for a 'sort of' directory type website.
The <a href> is built from the recordset of URL's which is all working no
problem, easy stuff.
|
by: Stefan Weiss |
last post by:
Hi.
(this is somewhat similar to yesterday's thread about empty links)
I noticed that Tidy issues warnings whenever it encounters empty
tags, and strips those tags if cleanup was requested. This is okay in
some cases (such as <tbody>), but problematic for other tags (such as
<option>). Some tags (td, th, ...) do not produce warnings when they are
empty.
|
by: Veli-Pekka Tätilä |
last post by:
Hi,
My first post here. I've found some serious accessibility flaws in the
Python 2.4 docs and wish they could be rectified over time. I'm very new to
Python and initially contacted docs at python org, However, I haven't gotten
a reply for a week or so, and figured out I could post here for a larger
audience, then.
Original message follows:
Hello,
|
by: Robert Neville |
last post by:
I am having some trouble with some old code revolving around custom
form navigation buttons. My main form has a sub-form with these custom
navigation buttons. In other words, the code should be modular and
work across forms and sub-forms. My previous code was taken from the
Access Expert Solutions 97 (Leszynski) many years ago. As my database
became more complex with multiple sub-forms and intricate combo boxes,
the code faltered.
Some...
|
by: Sandy.Pittendrigh |
last post by:
I don't want to get into a frames discussion here. We all know
they have numerous drawbacks, especially with search engine visibility.
(Google, ironically, uses framesets for displaying individual news
group posts).
Despite the trouble they cause, it is still tempting to use frames,
occasionally,
for instance for machine-generated pages that might have a large number
of left-side
navigation links. If you do use frames in that...
| |
by: Paul |
last post by:
On my local site, I have a folder that is security trimmed, so that only
members of a Role can see it after they register and log on (I set the
memberships). All works fine locally.
However, when I deployed to my ISP, the security trimming does not work.
Here is the relevant code. I can add users just fine, they show up in the
ISP SQL Server database, and I can log on and off.
|
by: Paul |
last post by:
I want the <div id="navigation"column to be the same color all the way to
the bottom. The "background-image: url(bg_menu_tile.gif);" was a try to
force it with a long 1-pixel graphic - didn't work. Any ideas?
Here's the HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
|
by: EA |
last post by:
I am sure I must be missing something about building navigation bars with
CSS.
Yes it is a very clever and efficient way to format navigation structures on
simple one navigation level webs, i.e. six buttons which when clicked go to
a separate web page. But here is where I must be missing something, am I
right in thinking that if you wish to have nested navigation structures then
each individual page of the web site must have a different...
|
by: emalcolm_FLA |
last post by:
Hello and TIA for your consideration.
I have created several db's for a non-profit and they want custom
navigation buttons to display "You are on the first record, last
record, etc". With this ng help I've created code for all except the
add new record command button.
If I create individual sub functions behind each form, no problem.
The problem is I am trying to create a re-usable module.
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |