Reputation: 2002
Trying to set permission as "fileOrganizer" for a user on a shared google drive folder, but the v3 (and v2) API giving error FileOrganizer role is only valid for shared drives
, and I could NOT find a way to specify that the folder is on a shared drive.
It is possible to set same permission via UI.
Code
gapi.client.drive.permissions
.create({
fileId: folderId,
sendNotificationEmail: false,
supportsAllDrives: true,
role: 'fileOrganizer' // 'writer' works
type: 'user',
emailAddress
}).then(
API Response
{
"error": {
"errors": [
{
"domain": "global",
"reason": "fileOrganizerOnNonTeamDriveNotSupported",
"message": "FileOrganizer role is only valid for shared drives."
}
],
"code": 403,
"message": "FileOrganizer role is only valid for shared drives."
}
}
Points to note
permissions.create
.I tried various combinations like passing driveId without any luck. Are there any other options?
Upvotes: 2
Views: 2272
Reputation: 26796
fileOrganizer
is only a valid choice for the whole shared drive rather than a single file on this driveWhat you can do instead:
role
fileOrganizer
for the whole drive (specifying the shared Drive Id as file Id)writer
, reader
, commenter
or owner
(for the latter case specifying transferOwnership
true
) as role
.Upvotes: 1