Hey Dumitru,
The problem is probably in case #1:
/* 1. */
IList roles = node.Roles;
if (roles != null && roles.Count > 0) {
foreach (string rolename in roles)
if (rolename == "*" || context.User.IsInRole (rolename))
return true;
return false;
}
Either the rolename is not parsed correctly or context.User.IsInRole (rolename)
works wrong. To check the later, you may run 'context.User.IsInRole
("Administrator")' within your user code and see the result.
Regards,
Konstantin Triger
________________________________
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dumitru Ban
Sent: Tuesday, May 29, 2007 11:45 AM
To: [email protected]
Subject: [Mono-dev] SiteMapProvider patch
Hi,
I'm trying to create a patch for SiteMapProvider->IsAccessibleToUser method.
Let's say a web.sitemap file is present, having the following content:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="home.aspx" title="Home">
<siteMapNode title="Test_no_url_no_roles"/>
<siteMapNode title="Test_no_url_roles" roles="Administrator"/>
</siteMapNode>
</siteMap>
With Microsoft .NET, the "Test_no_url_no_roles" node is not accessible to any
user and the "Test_no_url_roles" is accessible only to an Administrator.
In mono, both nodes are accessible to anyone. And this is because if the url of
the node is null or is the empty string, the method returns true.
On the method there is a [MonoTODO ("need to implement cases 2 and 3")]. But
number 2 is already started and the code
String url = node.Url;
if (String.IsNullOrEmpty(url))
return true;
is already there.
Shouldn't we have the same behaviour as Microsoft .NET?
Thanks & best regards,
Dumi.
_______________________________________________
Mono-devel-list mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/mono-devel-list