Share via


InheritableProperty<TValueType>.SetInherit Method (Boolean, Boolean)

Sets the flag to indicate whether this property inherits its value from its parent site.

Namespace:  Microsoft.SharePoint.Publishing
Assembly:  Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)

Syntax

'Declaration
Public Function SetInherit ( _
    inherit As Boolean, _
    forceAllSubWebInherit As Boolean _
) As LongRunningOperationJob
'Usage
Dim instance As InheritableProperty
Dim inherit As Boolean
Dim forceAllSubWebInherit As Boolean
Dim returnValue As LongRunningOperationJob

returnValue = instance.SetInherit(inherit, _
    forceAllSubWebInherit)
public LongRunningOperationJob SetInherit(
    bool inherit,
    bool forceAllSubWebInherit
)

Parameters

  • forceAllSubWebInherit
    Type: System.Boolean

    Forces all subsites to inherit this value, even if the property on a subsite currently does not inherit.

Return Value

Type: LongRunningOperationJob
A flag indicating whether this property inherits its value from its parent site.

Remarks

This method sets the inheritance of a PublishingWeb object. The current user must have permissions to set the inheritance value for the current PublishingWeb object. If there are child PublishingWeb objects set to inherit, they are updated with the new values regardless of whether the current user has permissions to modify the child PublishingWeb objects.

If forceAllSubWebInherit is set to True, the current user must have permissions to modify any child PublishingWeb objects that are marked as inheriting. When breaking inheritance, the currently inherited value is kept.

See Also

Reference

InheritableProperty<TValueType> Class

InheritableProperty<TValueType> Members

SetInherit Overload

Microsoft.SharePoint.Publishing Namespace

InheritableProperty<TValueType>