Export (0) Print
Expand All

SiteMapProvider.IsAccessibleToUser Method

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)

public virtual bool IsAccessibleToUser(
	HttpContext context,
	SiteMapNode node
)

Parameters

context
Type: System.Web.HttpContext

The HttpContext that contains user information.

node
Type: System.Web.SiteMapNode

The SiteMapNode that is requested by the user.

Return Value

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

ExceptionCondition
ArgumentNullException

context is null.

- or -

node is null.

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft