Skip to content

Commit

Permalink
Update AddListFoldersToSiteTemplate.cs (#3918)
Browse files Browse the repository at this point in the history
Co-authored-by: Maxime HAZEBROUCQ (Ext) <[email protected]>
Co-authored-by: Gautam Sheth <[email protected]>
  • Loading branch information
3 people authored Jun 26, 2024
1 parent 11dd5b0 commit 4d1f7ef
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ protected override void ExecuteCmdlet()
var tokenParser = new Framework.Provisioning.ObjectHandlers.TokenParser(ClientContext.Web, template);

//We will remove a list if it's found so we can get the list
ListInstance listInstance = template.Lists.Find(l => tokenParser.ParseString(l.Title) == spList.Title);
ListInstance listInstance = template.Lists.Find(l => tokenParser.ParseString(l.Title) == spList.Title);

if (listInstance == null)
{
throw new ApplicationException("List does not exist in the template file.");
Expand Down Expand Up @@ -158,6 +158,10 @@ private PnP.Framework.Provisioning.Model.Folder GetFolder(Microsoft.SharePoint.C
var roleBindings = roleAssignment.RoleDefinitionBindings;
foreach (var roleBinding in roleBindings)
{
if (roleBinding.Name == "Limited Access")
{
continue;
}
retFolder.Security.RoleAssignments.Add(new PnP.Framework.Provisioning.Model.RoleAssignment() { Principal = principalName, RoleDefinition = roleBinding.Name });
}
}
Expand Down

0 comments on commit 4d1f7ef

Please sign in to comment.