SPWebPartManager.GetPermissions Method
Gets the permissions of the current user on the Web Part.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Parameters
- webPart
- Type: System.Web.UI.WebControls.WebParts.WebPart
A Web Part on which to evaluate the permissions of the current user.
Return Value
Type: Microsoft.SharePoint.WebPartPages.PermissionsAn 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.
| Exception | Condition |
|---|---|
| ArgumentNullException |
webPart is null. |
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.