I'm trying to get folder and file permissions which is located in Shared Drive. All I can get is permissions list for root Shared Drive but trying to run below code on any ID of file or folder inside throw error.
Relavant Facts
- We are using Google Workspace Business Plus subscription
- I am domain superadmin
- I have access to this file in Shared Drive but I expect to have access to every file as an domain admin.
- Right now I'm calling the below script from web IDE of Apps Script so it is working in my grant scope.
- I am the script owner
- Script is on My rive
Script
function getPermissions_(driveFileID, sharedDriveSupport){
var thisDrivePermissions = Drive.Permissions.list(
driveFileID,
{
useDomainAdminAccess: USE_DOMAIN_ADMIN_ACCESS,
supportsAllDrives: sharedDriveSupport
}
);
return thisDrivePermissions;
}
Errors
GoogleJsonResponseException: API call to drive.permissions.list failed with error: Shared drive not found: xxxxxxxx
GoogleJsonResponseException: API call to drive.permissions.list failed with error: File not found:
How can I get the file permissions list in Google Shared Drive with Apps Script?
`) or add headings. When adding new content, add it thinking on first time readers, ...and people with bad memory like me :) – Rubén Nov 03 '22 at 17:11