[BUG] Set-PnPList Cmdlet Does Not Enforce WriteSecurity Changes on SharePoint Document Library
Reporting an Issue or Missing Feature
When using the Set-PnPList cmdlet to modify the WriteSecurity property on a SharePoint document library, the ReadSecurity parameter update works as expected, but changing the WriteSecurity parameter does not seem to have any effect on the list's write permissions, even though Get-PnPList shows the updated WriteSecurity value when retrieving the list properties.
Expected behavior
Using Set-PnPList -WriteSecurity should update the write security settings on the list and enforce the change in the SharePoint UI and behavior. For example, setting WriteSecurity to control whether all users can edit, only item authors can edit, or no users can edit should take effect immediately and restrict write permissions accordingly.
Actual behavior
The WriteSecurity setting appears to be accepted by the cmdlet without error and Get-PnPList confirms that the setting is updated.
However, the actual write permissions on the list are not affected by this change and users can still write as before. The WriteSecurity update does not enforce the expected write restrictions on list items.
At the same time Set-PnPList -ReadSecurity 2 indeed works, and items users have not created become invisible for them.
Steps to reproduce behavior
Set-PnPList 'Slides' -ReadSecurity 1 -WriteSecurity 2
Get-PnPList 'Slides' -Includes ReadSecurity, WriteSecurity | fl *security
- Observe that
ReadSecurityworks and enforces read restrictions. - Observe that
WriteSecuritydisplays the updated value but does not enforce write restrictions on the list.
What is the version of the Cmdlet module you are running?
3.1.119
Which operating system/environment are you running PnP PowerShell on?
- [x] Windows
- [ ] Linux
- [ ] MacOS
- [ ] Azure Cloud Shell
- [ ] Azure Functions
- [ ] Other : please specify (please fill in your environment)
Similar Issues
https://github.com/pnp/PnP-PowerShell/issues/847
Update: Tried the following code as per the suggestion from @Zerg00s https://github.com/pnp/PnP-PowerShell/issues/847#issuecomment-327041671
$list = Get-PnPList 'Slide' -Includes ReadSecurity, WriteSecurity
$list.ReadSecurity = 1
$list.WriteSecurity = 2
$list.Update()
$list.Context.ExecuteQuery()
However, this does not seem to resolve the issue.
@YuriySamorodov - this is not something we can fix. Please raise an issue with MS support and check. Not sure if this is even possible in document libraries, should work in lists. Also, since you tried with CSOM and it didnt work, we wont be able to fix it either. Closing this.