ManagementAuthorizationInfo.IsRole Property

Definition

Gets a value indicating whether the value specified in the Name property is a security role.

public:
 property bool IsRole { bool get(); };
public bool IsRole { get; }
member this.IsRole : bool
Public ReadOnly Property IsRole As Boolean

Property Value

true if the value specified in the Name property is a security role; otherwise, false.

Examples

The following example displays a collection of ManagementAuthorizationInfo objects and displays the IsRole property values for each element of the collection. This code example is part of a larger example provided for the ManagementAuthorization class.

foreach (ManagementAuthorizationInfo authorizedInfo in authorizedCollection)
{
    message = message + "\nName: " + authorizedInfo.Name;
    message = message + "     ConfigurationPath: " + 
        authorizedInfo.ConfigurationPath;
    message = message + "     IsRole: " + authorizedInfo.IsRole;

    // Check to see if the user is already in the allowed users collection.                
    if (userName.Equals(authorizedInfo.Name))
    {
        isInCollection = true;
    }
}

Remarks

You can use the IsRole property to check whether the authorized user is in a security role.

On the IIS Manger Permissions page in IIS Manager, an IsRole value of true displays a Group type for the user, and a value of false displays a User type for the user.

The values of the IsRole and Name properties are stored together in the Administration.config file.

Applies to