I create the Web Part for SharePoint 2010, which contained simple custom property with PersonalizationScope.User. Web part inherited from the System.Web.UI.WebControls.WebParts.WebPart
private int _mainBodyBorderWidth = 0; [Personalizable(PersonalizationScope.User), WebBrowsable(true), WebDisplayName("Main Body Border Width"), WebDescription("Set main body border width"), Category("Style")] public int MainBodyBorderWidth { get { return _mainBodyBorderWidth; } set { _mainBodyBorderWidth = value; } }
When Site Administrator or users with permission “Add and Customize Pages” clicked “Personalize Page” and than “Edit My Web Part” this property was displayed in the web part tool pane. However users with standard permission level “Contribute” couldnot see this property. After some investigation, I came to know that
the following considerations must be applied for the web part which user without permission “Add and Customize Pages” can add/remove or modify.
-
In SP 2010
TypeName
attribute of the tag>SafeContol
should use particular type name instead wildcard. -
Attribute
Safe
of the tag>SafeContol
set to “True” -
Attribute
SafeAgainstScript
also set to “True” AndSafeControl
tag will look similar to this:
<SafeControl Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Namespace="Microsoft.SharePoint.WebPartPages" TypeName="ListViewWebPart" Safe="True" SafeAgainstScript="True" />