none
permissions not retained when using Save Site As Template in WSS

    Question

  • Hello,
    Does any one know how to fix the issue with permission not retained in WSS in .NET?
    I have not trying to using the "Save Site As Template" feature to new site using the site templated I created previously but new site lost all the permssions I configured for it.
    Does any one have any suggestion on how to work around this issue?

    Any idea or suggestion is greatly appreciated.

    Monday, July 06, 2009 3:50 PM

Answers

  • You will need to create a feature receiver which uses the API to code against SharePoint.  In the feature receiver you need to implement the featureactivated event.  The feature needs to be scoped at the web level.  From the properties of the feature receiver you can get the current web and then get a list in the web.  Once you have the list you can break the role inheritance (to create a custom security) and add role assignments for the AD groups, Users or SharePoint groups you want to define permissions for.
    My SharePoint Blog - http://www.davehunter.co.uk/blog
    Tuesday, July 07, 2009 7:59 PM

All replies

  • Site Templates do not store the security settings http://office.microsoft.com/en-us/sharepointtechnology/HA101577801033.aspx.  If you want to create a templated site you need to create a site definition and add a feature which defines your security.  The feature would be a web scoped feature receiver which allows you to code against the site using the API.


    My SharePoint Blog - http://www.davehunter.co.uk/blog
    Monday, July 06, 2009 4:04 PM
  • Dave,
    Thank you for replying to my post.  Could you please show me how to "create a site definition and add a feature which defines your security"?  Could you please point me to some resources as reference to get me started?  I only know how to create a site within the Sharepoint web interface but I do not know how to define security for it.  Could you please explain it in more details?

    Thanks a lot for your time and help!
    Monday, July 06, 2009 6:30 PM
  • What permissions do you want to define?  Are these at the site or list level?
    My SharePoint Blog - http://www.davehunter.co.uk/blog
    Monday, July 06, 2009 8:30 PM
  • The permissions are set at the list level.
    Tuesday, July 07, 2009 12:55 PM
  • You will need to create a feature receiver which uses the API to code against SharePoint.  In the feature receiver you need to implement the featureactivated event.  The feature needs to be scoped at the web level.  From the properties of the feature receiver you can get the current web and then get a list in the web.  Once you have the list you can break the role inheritance (to create a custom security) and add role assignments for the AD groups, Users or SharePoint groups you want to define permissions for.
    My SharePoint Blog - http://www.davehunter.co.uk/blog
    Tuesday, July 07, 2009 7:59 PM
  • Hello Dave,

    I've only just seen this thread as I'm having some issues with saving a site as a site template in SharePoint 2010 and the permissions not being set with it.  I've realised this is the case that it will not come across but I'm after a workaround.  I'm not sure if I have to create a workflow or not but I'm not sure how to get to the site permissions. 

    Any advice?

    Thank you,

    Hayley

    Wednesday, October 03, 2012 3:21 PM