1
votes

Sharepoint 2010

I have 3 sets of Document Libraries that contain a number of documents organised in folders. The idea is to be able to instantiate any of those 3 document libraries for any site in the collection. So that the structure is replicated upon creation.

The issue is that the libraries have a constrained set of permissions that are different from the parent (stop inheriting permissions option). But I've noticed that when I instantiate any of the library templates the permissions aren't kept.

Is there a way to store a set of specific permissions within the template itself?

For example, this could be the structure for one of the document libraries:

  • Document 1 (accessible by all)
  • Document 2 (accessible by all)
  • Folder 1 (accessible by all)
  • >> Document 3
  • >> Document 4
  • >> Document 5
  • Folder 2 (only accessible by the management group)
  • >> Document 6
  • >> Document 7

-------EDIT---------

I have tried with the Powershell cmdlets

Exported the library with:

Export-SPWeb -Identity http://server/sites/site1/SampleLibrary -path "sampleLibraryExport.cmp" -IncludeUserSecurity -ItemUrl "3rd Party Engagements" 

Deleted the library and reimported again with:

Import-SPWeb -Identity http://server/sites/site1/SampleLibrary -path "sampleLibraryExport.cmp" -IncludeUserSecurity

However, the custom permissions are gone and have now been set to the farm-admin account and inherited across files

Thanks,

Jaume

2
I think you're going to have to script that as part of deploying those libraries to your site. This might be a better question for the SharePoint site on Stack Exchange... sharepoint.stackexchange.comGlenn Ferrie

2 Answers

1
votes

to transfer library with permissions and store user identity you can try to use SharePoint deployment. Internally Import-SPWeb also uses SharePoint deployment but it doesn't supported well. If you'll work with SharePoint object model directly and will write some C# or PowerShell it will be possible to transfer list with permissions. You can find here some samples for transferring spweb, but also some code for lists, look at method GetExportList. I'm not pretending for ready solution, but this could be helpful for you if you'll look at SharePoint content deployment with your problem

0
votes

Here's the solution that I used in the end, which involves a custom PowerShell script that loops through files and folders and sets the individually-defined permissions.

http://codebroth.com/blog/2012/10/copying-sharepoint-2010-document-libraries-wit-powershell/