Export (0) Print
Expand All

SPSite.WriteLocked Property

Windows SharePoint Services 3

Gets or sets a Boolean value that specifies whether the site collection is locked and unavailable for Write access.

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

public bool WriteLocked { get; set; }

Property Value

Type: System.Boolean
true if the site collection is locked for Write access; otherwise, false.

Getting the value of the WriteLocked property requires site collection administrator rights, while setting the value requires global administrator rights.

This lock is enforced as if the site were permanently over its storage quota limit. Content can be deleted or reduced in size, but it cannot be increased until the lock is removed.

The following code example applies a lock on writing, but not on reading, to a site collection.

using (SPSite oSiteCollection = new SPSite("http://Site_Name"))
{
    oSiteCollection.WriteLocked = true;
    oSiteCollection.ReadLocked  = false;
    oSiteCollection.LockIssue   = "Customer did not pay bill.";
}
NoteNote

Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Best Practices: Using Disposable Windows SharePoint Services Objects.

Community Additions

ADD
Show:
© 2015 Microsoft