Partager via


WriteLocked Property

The WriteLocked property of the SPSite class gets or sets a Boolean value that specifies whether the site collection is locked and unavailable for Write access.

Property Value

true if the site collection is locked for Write access; otherwise, false.

Remarks

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 never increased until the lock is removed.

Example

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

This example requires using directives (Imports in Visual Basic) for both the Microsoft.SharePoint and Microsoft.SharePoint.Administration namespaces.

Requirements

Platforms: Microsoft Windows Server 2003

Security: Code Access Security