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 function IsAuthorized(
	principal : IPrincipal, 
	configurationPath : String
) : boolean

Parameters

principal
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.
configurationPath
Type: System..::..String
The configuration path.

Return Value

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

ExceptionCondition
System..::..ArgumentNullException

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.

No code example is currently available or this language may not be supported.

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

No code example is currently available or this language may not be supported.

Community Additions

ADD
Show:
© 2014 Microsoft