Drive.Drives.list({pageToken:pageToken, maxResults:100, useDomainAdminAccess:true});
I was able to get the id
and name
values from the return values that get, but I cannot get the restrictions
and I cannot set them.
How can I retrieve and configure it?
Dear Tanaike, Thank you for your reply.
I was able to get it.
I would like to ask you more information, but the reply in the comment was not enough characters, so I will write it down here.
Similarly, I would like to set restrictions
, but I tried several Drives.update
in the following pattern, but it doesn't work.
I'm sorry, but could you tell me how to set it up?
For 1, the following error occurs:
GoogleJsonResponseException: The requesting user does not have the administrator privilege required to manage the shared drive0ADwtxWXOI0f9Uk9PVA.
For 2, the condition appears to have been ignored.
Here's the code I tried:
//1
var updateResources={
useDomainAdminAccess: true,
name: "New Name",
restrictions: {
adminManagedRestrictions: true,
domainUsersOnly: true,
driveMembersOnly: true,
copyRequiresWriterPermission: true
},
fields: "items(name, restrictions)"
};
varres_update=Drive.Drives.update(updateResources,driveID);
// 2
var updateResources={
useDomainAdminAccess: true,
name: "New Name",
fields: "items(name, restrictions)"
};
var updateOptions = {
restrictions: {
adminManagedRestrictions: true,
domainUsersOnly: true,
driveMembersOnly: true,
copyRequiresWriterPermission: true
}
};
varres_update = Drive.Drives.update(updateResources, driveID, updateOptions);
Thank you for your cooperation.
google-apps-script
Drive.Drives.list
only returns id,name,kind
as the default.Therefore, fields
must be used to obtain restrictions
.At this time, you can choose to retrieve all properties, or to retrieve certain properties.
Drive.Drives.list ({pageToken:pageToken, maxResults:100, useDomainAdminAccess:true, fields:"*"});
Drive.Drives.list({pageToken:pageToken,maxResults:100,useDomainAdminAccess:true,fields:"items(name,restrictions,id),nextPageToken});
name, restrictions, id, nextPageToken
is returned.
582 PHP ssh2_scp_send fails to send files as intended
613 GDB gets version error when attempting to debug with the Presense SDK (IDE)
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
578 Understanding How to Configure Google API Key
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.