Editar

Partilhar via


SiteMapProvider.IsAccessibleToUser(HttpContext, SiteMapNode) Method

Definition

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

public:
 virtual bool IsAccessibleToUser(System::Web::HttpContext ^ context, System::Web::SiteMapNode ^ node);
public virtual bool IsAccessibleToUser (System.Web.HttpContext context, System.Web.SiteMapNode node);
abstract member IsAccessibleToUser : System.Web.HttpContext * System.Web.SiteMapNode -> bool
override this.IsAccessibleToUser : System.Web.HttpContext * System.Web.SiteMapNode -> bool
Public Overridable Function IsAccessibleToUser (context As HttpContext, node As SiteMapNode) As Boolean

Parameters

context
HttpContext

The HttpContext that contains user information.

node
SiteMapNode

The SiteMapNode that is requested by the user.

Returns

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

Exceptions

context is null.

-or-

node is null.

Remarks

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

Applies to

See also