Skip to content

Commit 1605bb4

Browse files
authored
Merge pull request #4508 from KoenZomers/AddAllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled
Adding `-AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled` to `Set-PnPTenant`
2 parents a4c63e0 + 5889523 commit 1605bb4

File tree

4 files changed

+28
-20
lines changed

4 files changed

+28
-20
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
3030
- Added `Restore-PnPFlow` cmdlet which allows for undeleting a flow within 21 days of deletion. [#4415](https://github.com/pnp/powershell/pull/4415)
3131
- Added `-ExcludeDeprecated` to `Export-PnpTaxonomy` which allows for deprecated terms to be excluded from the export [#4053](https://github.com/pnp/powershell/pull/4053)
3232
- Added `-HidePeoplePreviewingFiles` to `Set-PnPSite` which allows for hiding the people previewing files feature on a site [#4416](https://github.com/pnp/powershell/pull/4416)
33+
- Added `-AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled` to `Set-PnPTenant` which allows for updating of web property bag when DenyAddAndCustomizePages is enabled
3334

3435
### Changed
3536

documentation/Set-PnPTenant.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ Set-PnPTenant [-SpecialCharactersStateInFileFolderNames <SpecialCharactersState>
160160
[-GuestSharingGroupAllowListInTenantByPrincipalIdentity <string[]>]
161161
[-OneDriveSharingCapability <SharingCapabilities>]
162162
[-DelayDenyAddAndCustomizePagesEnforcement <Boolean>]
163+
[-AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled <Boolean>]
163164
[-Force] [-Connection <PnPConnection>]
164165
```
165166

@@ -242,6 +243,20 @@ Accept pipeline input: False
242243
Accept wildcard characters: False
243244
```
244245
246+
### -AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled
247+
Enables or disables web property bag update when DenyAddAndCustomizePages is enabled. When AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled is set to $true, web property bag can be updated even if DenyAddAndCustomizePages is turned on when the user had AddAndCustomizePages (prior to DenyAddAndCustomizePages removing it).
248+
249+
```yaml
250+
Type: Boolean
251+
Parameter Sets: (All)
252+
253+
Required: False
254+
Position: Named
255+
Default value: None
256+
Accept pipeline input: False
257+
Accept wildcard characters: False
258+
```
259+
245260
### -ApplyAppEnforcedRestrictionsToAdHocRecipients
246261
When the feature is enabled, all guest users are subject to conditional access policy. By default guest users who are accessing SharePoint Online files with pass code are exempt from the conditional access policy.
247262

src/Commands/Admin/SetTenant.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,9 @@ public class SetTenant : PnPAdminCmdlet
480480
[Parameter(Mandatory = false)]
481481
public string[] GuestSharingGroupAllowListInTenantByPrincipalIdentity { private set; get; }
482482

483+
[Parameter(Mandatory = false)]
484+
public bool? AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled { private set; get; }
485+
483486
protected override void ExecuteCmdlet()
484487
{
485488
AdminContext.Load(Tenant);
@@ -1539,6 +1542,11 @@ protected override void ExecuteCmdlet()
15391542
Tenant.ODBSharingCapability = OneDriveSharingCapability.Value;
15401543
modified = true;
15411544
}
1545+
if(AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled.HasValue)
1546+
{
1547+
Tenant.AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled = AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled.Value;
1548+
modified = true;
1549+
}
15421550
if (GuestSharingGroupAllowListInTenantByPrincipalIdentity !=null)
15431551
{
15441552
if (GuestSharingGroupAllowListInTenantByPrincipalIdentity.Length > 0)

src/Commands/Model/SPOTenant.cs

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ public class SPOTenant
250250
public bool? SharePointAddInsDisabled { private set; get; }
251251
public SharingCapabilities? OneDriveSharingCapability { private set; get; }
252252
public string[] GuestSharingGroupAllowListInTenantByPrincipalIdentity { private set; get; }
253+
public bool? AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled { private set; get; }
253254
#endregion
254255

255256
public SPOTenant(Tenant tenant, ClientContext clientContext)
@@ -739,26 +740,8 @@ public SPOTenant(Tenant tenant, ClientContext clientContext)
739740
{
740741
}
741742

742-
try
743-
{
744-
AppBypassInformationBarriers = tenant.AppBypassInformationBarriers;
745-
}
746-
catch
747-
{
748-
}
749-
750-
try
751-
{
752-
if (tenant.DefaultODBMode != null)
753-
{
754-
DefaultOneDriveInformationBarrierMode = Enum.Parse<InformationBarriersMode>(tenant.DefaultODBMode);
755-
}
756-
}
757-
catch
758-
{
759-
}
760-
761-
743+
try { AppBypassInformationBarriers = tenant.AppBypassInformationBarriers; } catch { }
744+
try { if (tenant.DefaultODBMode != null) DefaultOneDriveInformationBarrierMode = Enum.Parse<InformationBarriersMode>(tenant.DefaultODBMode); } catch { }
762745
try { CoreSharingCapability = tenant.CoreSharingCapability; } catch { }
763746
try { EnableVersionExpirationSetting = tenant.EnableVersionExpirationSetting; } catch { }
764747
try { BlockUserInfoVisibilityInOneDrive = tenant.BlockUserInfoVisibilityInOneDrive; } catch { }
@@ -789,6 +772,7 @@ public SPOTenant(Tenant tenant, ClientContext clientContext)
789772
try { SharePointAddInsDisabled = tenant.SharePointAddInsDisabled; } catch { }
790773
try { OneDriveSharingCapability = tenant.ODBSharingCapability; } catch { }
791774
try { GuestSharingGroupAllowListInTenantByPrincipalIdentity = tenant.GuestSharingGroupAllowListInTenantByPrincipalIdentity?.ToArray(); } catch { }
775+
try { AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled = tenant.AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled; } catch { }
792776
}
793777
}
794778
}

0 commit comments

Comments
 (0)