1

I have saved a sub-site as a template. Then, I created a sub-site based on the template. But it seems that the template will not include the site permissions. So can anyone provide any advice on this?

  • When you save a site as a template, one of the options is to retain permissions or inherit from parent. Did that not work? – Ransher Singh May 14 '15 at 15:08
  • @RansherSingh not sure i understand your point, when saving a subsite as a template, there is an option to include the content in the template,, but there is not any option to include permission .... – john Gu May 14 '15 at 15:13
  • sorry I meant during site creation from template..You can specify if the site inherits its permissions Groups from the parent site (Use same permissions as parent site) or not (Use unique permissions). If you choose the former, you will inherit the permissions Groups of the site collection in the hierarchy above the site you’re about to create. If you choose the latter, you will have new Groups without users and can assign unique permissions. – Ransher Singh May 14 '15 at 15:20
  • 3
    I am afraid that the site templates do not contain user and groups information. All elements will be assigned default permissions, it does not matter if you choose to inherit permissions or not. Your best bet would be to user PowerShell to export and import users. You might want to look into the following articles. sharepoint-works.blogspot.ca/2013/01/… sharepoint-works.blogspot.ca/2013/01/… – Arsalan Shahid May 14 '15 at 15:48
  • @Arsalan thanks for the reply. but i am using template mainly to allow end users to create new sub sites easily,, so i though that i can add all the necessary content inside the templete, then end users can create new sub sites based on the template. this worked well regarding the Lists, workflow, etc but the template will not contain the permission,,, so this will be a complex task to inform end users that they should stop inheriting permission and to define there own security groups or they need to import/export permissions,,,, so is there any work around for this ?? thanks – john Gu May 14 '15 at 15:56
3

If you have custom security definitions defined inside your source site, they will not be retained in the template as they cannot be expressed using the declarative language the template uses internally. Your only option really is whether or not to inherit from parent at site creation, as Ransher suggested above.

You'll need to manually recreate the security definitions after site creation, or resort to a code based approach like a WebProvisioned handler.

  • but when creating sub site using the template, the Parent will be referring to the site collection and not to the template, which is not what i am searching for ?? now inside the sub site which i use to create the temple from, i define its own security groups and users (different from the site collection security settings),, and i need these security groups and users to be saved in the template ... – john Gu May 14 '15 at 16:00
  • Sorry, the template architecture does not support that. You're going to need code or a manual approach. – Derek Gusoff May 14 '15 at 20:09
  • can you please advice what type of code i can us in this case? – john Gu May 15 '15 at 10:28
  • 1
    A WebProvisioned event. Another thing you'll need to consider is that you cannot have multiple groups with the same name inside a site collectoin. msdn.microsoft.com/en-us/library/… Or perhaps a Feature Receiver msdn.microsoft.com/en-us/library/ee231604.aspx – Derek Gusoff May 15 '15 at 13:07
  • so i can force the group to have the sub site name then add -Visitors , -Contributors & -FullControll,, is this valid? – john Gu May 15 '15 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.