Skip to content

Commit 4d1f7ef

Browse files
mhazebroucqMaxime HAZEBROUCQ (Ext)gautamdsheth
authored
Update AddListFoldersToSiteTemplate.cs (#3918)
Co-authored-by: Maxime HAZEBROUCQ (Ext) <maxime.hazebroucq@ext.hermes.com> Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>
1 parent 11dd5b0 commit 4d1f7ef

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Commands/Provisioning/Site/AddListFoldersToSiteTemplate.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ protected override void ExecuteCmdlet()
6262
var tokenParser = new Framework.Provisioning.ObjectHandlers.TokenParser(ClientContext.Web, template);
6363

6464
//We will remove a list if it's found so we can get the list
65-
ListInstance listInstance = template.Lists.Find(l => tokenParser.ParseString(l.Title) == spList.Title);
66-
65+
ListInstance listInstance = template.Lists.Find(l => tokenParser.ParseString(l.Title) == spList.Title);
66+
6767
if (listInstance == null)
6868
{
6969
throw new ApplicationException("List does not exist in the template file.");
@@ -158,6 +158,10 @@ private PnP.Framework.Provisioning.Model.Folder GetFolder(Microsoft.SharePoint.C
158158
var roleBindings = roleAssignment.RoleDefinitionBindings;
159159
foreach (var roleBinding in roleBindings)
160160
{
161+
if (roleBinding.Name == "Limited Access")
162+
{
163+
continue;
164+
}
161165
retFolder.Security.RoleAssignments.Add(new PnP.Framework.Provisioning.Model.RoleAssignment() { Principal = principalName, RoleDefinition = roleBinding.Name });
162166
}
163167
}

0 commit comments

Comments
 (0)