-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] HasUniqueRoleAssignments value is returned wrong while using Get-PnPProperty and Get-PnPFolder #4085
Comments
I cannot confirm this issue with I ran the command below in a libray with 2 folders and broke/inherited permissions multiple times and the command returned the correct result each time: Get-PnPFolder -List "Test library" -Includes ListItemAllFields.HasUniqueRoleAssignments | %{[PSCustomobject][ordered]@{Name = $_.Name; UniquePermissions = $_.ListItemAllFields.HasUniqueRoleAssignments}} It works also using the Get-PnPFolder -Url "Test library/Folder A" -Includes ListItemAllFields.HasUniqueRoleAssignments | %{[PSCustomobject][ordered]@{Name = $_.Name; UniquePermissions = $_.ListItemAllFields.HasUniqueRoleAssignments}} Could you please try upgrading to 2.5.0 ? |
Thanks for the testing @jackpoz |
Notice
Many bugs reported are actually related to the PnP Framework which is used behind the scenes. Consider carefully where to report an issue:
Invoke-PnPSiteTemplate
orGet-PnPSiteTemplate
? NoReporting an Issue or Missing Feature
HasUniqueRoleAssignments value is returned wrong while using Get-PnPProperty and Get-PnPFolder. I am trying to get details if a file or folder has unique permissions or not.
To get unique permission for itemI run:
$Item = Get-PnPListItem -List $LibraryName -Id $Document.Id
#Check if the Item has unique permissions
$HasUniquePermissions = $null
$HasUniquePermissions = Get-PnPProperty -ClientObject $Item -Property HasUniqueRoleAssignments**
I believe fuction is chaching data. Once I get a false value it keeps on giving me the false value.
Even if I run Get-PnPFolder:
$FolderObject = Get-PnPFolder -Url $DocumentServerRelativeURL -Includes "ListItemAllFields.HasUniqueRoleAssignments"
$HasUniquePermissions = $FolderObject.ListItemAllFields.HasUniqueRoleAssignments
Expected behavior
IT should return me correct value if the the item has unique permissions or not.
Actual behavior
Returning me wrong value of $HasUniquePermissionsFile
Steps to reproduce behavior
Please include complete script or code samples in-line or linked from gists
What is the version of the Cmdlet module you are running?
(you can retrieve this by executing
Get-Module -Name "PnP.PowerShell" -ListAvailable
)1.12.0
Which operating system/environment are you running PnP PowerShell on?
The text was updated successfully, but these errors were encountered: