Export (0) Print
Expand All

SiteMapProvider.IsAccessibleToUser Method

Note: This method is new in the .NET Framework version 2.0.

Retrieves a Boolean value indicating whether the specified SiteMapNode object can be viewed by the user in the specified context.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

'Declaration
Public Overridable Function IsAccessibleToUser ( _
	context As HttpContext, _
	node As SiteMapNode _
) As Boolean
'Usage
Dim instance As SiteMapProvider
Dim context As HttpContext
Dim node As SiteMapNode
Dim returnValue As Boolean

returnValue = instance.IsAccessibleToUser(context, node)
public boolean IsAccessibleToUser (
	HttpContext context, 
	SiteMapNode node
)
public function IsAccessibleToUser (
	context : HttpContext, 
	node : SiteMapNode
) : boolean

Parameters

context

The HttpContext that contains user information.

node

The SiteMapNode that is requested by the user.

Return Value

true if security trimming is enabled and node can be viewed by the user or security trimming is not enabled; otherwise, false.

Exception typeCondition

ArgumentNullException

context is a null reference (Nothing in Visual Basic).

- or -

node is a null reference (Nothing in Visual Basic).

The default behavior when security trimming is enabled is as described in the following table.

Condition

Return Value

The Roles exists on node and the current user is in at least one of the specified roles.

- or -

The current thread has an associated WindowsIdentity that has file access to the requested URL and the URL is located within the directory structure for the application.

- or -

The current user is authorized specifically for the requested URL in the authorization element for the current application and the URL is located within the directory structure for the application.

true

None of the preceding conditions is met.

false

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft