ModuleProvider.GetChildDelegationState(String) Method

Definition

When overridden in a derived class, returns the child delegation state.

public:
 virtual Microsoft::Web::Management::Server::DelegationState ^ GetChildDelegationState(System::String ^ path);
public virtual Microsoft.Web.Management.Server.DelegationState GetChildDelegationState (string path);
abstract member GetChildDelegationState : string -> Microsoft.Web.Management.Server.DelegationState
override this.GetChildDelegationState : string -> Microsoft.Web.Management.Server.DelegationState
Public Overridable Function GetChildDelegationState (path As String) As DelegationState

Parameters

path
String

The path of the calling host.

Returns

The current child DelegationState object.

Examples

The following example checks the value of the ManagementUnit property but does not use the information. The example returns a user-defined DelegationState object based on the value of the Microsoft.Web.Management.Server.ManagementAdministrationConfiguration.Modules property.

public override DelegationState GetChildDelegationState(string path) {

    if (String.IsNullOrEmpty(path)) {
        throw new ArgumentNullException("path");
    }
    if (path.IndexOf('/') != -1) {
        throw new InvalidOperationException("Delegation Only For ImmediateChildren");
    }
     
    if (ManagementUnit.Scope == ManagementScope.Server) {
        Trace.WriteLine("GetChildDelegationState at Server");
    } else if (ManagementUnit.Scope == ManagementScope.Site) {
        Trace.WriteLine("Site level GetChildDelegationState");
    }

    ManagementAdministrationConfiguration administration =
        ManagementUnit.Administration.GetDelegatedScope(path);

    if (administration.Modules[Name] == null) {
        return MyDelegatedModProviderHlpr.NoneDelegationState;
    }

    return MyDelegatedModProviderHlpr.ReadWriteDelegationState;
}
internal static class MyDelegatedModProviderHlpr {

    private const string ReadOnlyDelegationMode = "ReadOnly";
    private const string ReadWriteDelegationMode = "ReadWrite";
    private const string NoneDelegationMode = "None";
    private const string ParentDelegationMode = "Parent";

    public static readonly DelegationState ReadOnlyDelegationState =
        new DelegationState(ReadOnlyDelegationMode,
        ReadOnlyDelegationMode, "Lock feature config");
    public static readonly DelegationState ReadWriteDelegationState =
        new DelegationState(ReadWriteDelegationMode,
        ReadWriteDelegationMode, "Unlock feature config");
    public static readonly DelegationState NoneDelegationState =
        new DelegationState(NoneDelegationMode,
        NoneDelegationMode, "Lock feature configuration and make the feature invisible");
    public static readonly DelegationState ParentDelegationState =
        new DelegationState(ParentDelegationMode,
        ParentDelegationMode, "Set lock state to inherited");

}

Remarks

You can use the ManagementUnit property to determine the child delegation state.

Applies to