Compartilhar via


SPWebPartManager.GetPermissions Method

Gets the permissions of the current user on the Web Part.

Namespace:  Microsoft.SharePoint.WebPartPages
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
Public Function GetPermissions ( _
    webPart As WebPart _
) As Permissions
'Usage
Dim instance As SPWebPartManager
Dim webPart As WebPart
Dim returnValue As Permissions

returnValue = instance.GetPermissions(webPart)
public Permissions GetPermissions(
    WebPart webPart
)

Parameters

Return Value

Type: Microsoft.SharePoint.WebPartPages.Permissions
An enumeration value that indicates whether the current user can modify the Web Part and, if the user can modify it, whether the user can modify all properties or only personal view properties.

Exceptions

Exception Condition
ArgumentNullException

webPart is a null reference (Nothing in Visual Basic).

Remarks

The value returned by this method takes into account the user's rights, the page mode, whether the Web Part is shared or personalized, the value of the AllowEdit property, and the values of properties for the WebPartZone object that contains the Web Part.

See Also

Reference

SPWebPartManager Class

SPWebPartManager Members

Microsoft.SharePoint.WebPartPages Namespace