
I'm currently working on a project where I need to list all the folder names within a library in a SharePoint site, along with the permission level for each SharePoint group assigned to those folders.
To achieve this, I'm using the following URI to filter folder names and paths:
_api/web/lists/getbytitle('1 Project Mgmt')/items?$select=FileLeafRef,FileDirRef&$filter=FSObjType eq 1
Parse JSON Schema:
{
"type": "object",
"properties": {
"d": {
"type": "object",
"properties": {
"results": {
"type": "array",
"items": {
"type": "object",
"properties": {
"__metadata": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"uri": {
"type": "string"
},
"etag": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"Title": {
"type": "string"
},
"FileDirRef": {
"type": "string"
},
"FileLeafRef": {
"type": "string"
}
},
"required": [
"__metadata",
"FileDirRef",
"FileLeafRef"
]
}
}
}
}
}
}
The "FileLeafRef" represents the folder name, and "FileDirRef" represents the folder path.
For the next step, I attempted to send another HTTP request to SharePoint to extract the role assignments and role definition bindings. However, I encountered an issue where the folder path cannot be found. I've double-checked the correctness of the folder paths, ensured proper encoding, and validated permissions, but the problem persists.
I'm seeking guidance on how to troubleshoot this issue or if there are alternative solutions to extract SharePoint folder permissions successfully. Any insights or suggestions would be greatly appreciated.
Additional Information: At the last step, I intend to use "Add a new row into a table" to list out all the permission levels for each SharePoint permission group. Each row in the table would correspond to a folder, and one of the columns would display the permission levels for each SharePoint group assigned to that folder.
Thank you for your assistance!
@kt0606 ,
You could simply use Powershell
Get SharePoint Online Permissions Report using PowerShell (lepide.com)