Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

IsAuthorized Method

IIS 7.0

Retrieves a value indicating whether the specified principal is authorized for the specified configuration path.

Namespace:  Microsoft.Web.Management.Server
Assembly:  Microsoft.Web.Management (in Microsoft.Web.Management.dll)

public static bool IsAuthorized(
	IPrincipal principal,
	string configurationPath


Type: System.Security.Principal..::..IPrincipal
A System.Security.Principal..::..IPrincipal interface that represents the security context of the user on whose behalf the code is running.
Type: System..::..String
The configuration path.

Return Value

Type: System..::..Boolean
true if the principal is authorized for the specified configuration path; otherwise, false.


principal or configurationPath is nullNothingnullptrunita null reference (Nothing in Visual Basic).

This method checks the Administration.config file to determine whether the principal is an authorized user for the specified configuration path.

The following example demonstrates the IsAuthorized method. This code example is part of a larger example provided for the ManagementAuthorization class.

    ManagementAuthorization.IsAuthorized(principal, path).ToString());
SiteOwnerDetailsBag.Add(2, siteName as string);

The following example sets the principal parameter to an object that enables you to check the Windows group membership of the current user.

AppDomain domain = Thread.GetDomain();
WindowsPrincipal principal = (WindowsPrincipal)Thread.CurrentPrincipal;

Community Additions

© 2015 Microsoft