I'm new to writing and seeking amazing solutions for all the issues I encounter.
I have a website hosted on Google Drive, utilizing its SDK for Javascript. Everything functions exceptionally well, except for one problem. I need to adjust the permissions of certain files to "publish, allowing access to everyone without requiring identification."
After researching the Google Drive SDK:
https://developers.google.com/drive/v2/reference/permissions/update
However, I find it challenging to comprehend as I struggle with identifying where to obtain the necessary variables.
function updatePermission(fileId, permissionId, newRole) {
// First retrieve the permission from the API.
var request = gapi.client.drive.permissions.get({
'fileId': fileId,
'permissionId': permissionId
});
request.execute(function(resp) {
resp.role = newRole;
var updateRequest = gapi.client.drive.permissions.update({
'fileId': fileId,
'permissionId': permissionId,
'resource': resp
});
updateRequest.execute(function(resp) { });
});
}
My confusion lies in understanding how to determine: - permissionId - newRole (for setting a file to super public)
Although I have all file information (ids, urls, etc.), changing permissions proves to be complex.
Despite extensive searches on Google, I cannot locate any examples demonstrating how to make a file public.
Any guidance would be greatly appreciated!
Currently, uploading and accessing files on user accounts is smooth sailing; this permission adjustment is the only hiccup, haha.