Allow or Stop Contributors from modifying webpart properties

18 October 2011 5:38 AM Posted by Mano Mangaldas
Labels: , ,

Allow or Stop Contributors from modifying webpart properties

Unlike MOSS 2007, by default SP2010 gives permissions for modifying the webpart properties to designers and above. This means that contributors will no longer have access to modify webpart properties.

But there are a few things available that you can use to get more control over a webpart in a page..

Add additional properties in design time



Setting 'Safe Against Script' to false

This value is false by default which means SharePoint will not allow editing and configuration by site contributors.
If you want to continue to let a Web Part remain configurable, even bysite contributors, you can change the SafeAgainstScript attribute of the SafeControl declaration for that Web Part.

A value of true instructs SharePoint to allow editing and configuration even by site contributors.


Programmatically allow certain properties to be configured

There is also a new attribute, RequiresDesignerPermissionAttribute, which you can use to tag a property to make it configurable only by users with designer rights or higher. This last attribute overrides any configuration in the web.config, so if you declare a control as SafeAgainstScript but also define a property marked with RequiresDesignerPermissionAttribute, that property will still not be configurable by a contributor, and will require at least a designer role, regardless of the web.config configuration.

Comments (0)

Post a Comment