I have created a site definition but i need to limit what sub sites can be created by the user.
How can I do this with SharePoint 2010?
thanks
|
I have created a site definition but i need to limit what sub sites can be created by the user. How can I do this with SharePoint 2010? thanks |
|||
|
|
As part of the publishing features you can add AvailableWebTemplates and AvailablePageLayouts declaratively as feature properties in onet.xml:
The * can be replaced with a specific LCID (eg 1033) if you only want the template available for specific languages. Seperator is ; for templates and : for page layouts |
|||||
|
|
I would like to know if there is a declarative way to do it. But you can have a feature activtaed which receives following event whenever a new web is being created. You will have an opportunity to check for allowed templates and then redirect the users to error page if needed. public override void WebAdding(SPWebEventProperties properties) { // Check properties.Web.WebTemplate belongs to the allowed templates... and if not do following properties.Cancel = true; properties.Status = SPEventReceiverStatus.CancelWithRedirectUrl; properties.RedirectUrl = "/_layouts/Custom/error.aspx"; } |
|||
|
|