I grant permissions to a realtime file owned by one of my google accounts (dustin.wehr) to a second google account (d.dawg.fresh), using
gapi.client.load('drive', 'v3').then(function() {
gapi.client.drive.permissions.create({
fileId: fileid,
type: 'user',
role: 'writer',
emailAddress: email
});
This results in getting an email notification about the newly shared 0-byte shortcut file, which I can then see in the google drive webapp when logged in as d.dawg.fresh, where I verify that it has the same fileid as the shortcut file in my dustin.wehr drive account.
However, when I authenticate as d.dawg.fresh and try to load the file using that fileid (via realtime-client-utils.js), I get:
Drive Realtime API Error: not_found: File not found.
I use the same client id and app id throughout.
Before I give permissions to d.dawg.fresh, I get the expected error when I try to have d.dawg.fresh load it:
Drive Realtime API Error: forbidden: Access denied to file.
When I try to use either of gapi.client.drive.permissions.get
or gapi.client.drive.permissions.list
, authenticating from either account, I just get back incomprehensible objects that look like they were created from closure compiler code. I seem to remember those functions being useful before.
When I use "Try this API" at https://developers.google.com/drive/v3/reference/permissions/list logged in from either of the two accounts, I get exactly the same response; two permissions, one for writer and one for owner.
It gets better! I've found the above process works if I flip the roles of the two user accounts, i.e. I create the file with d.dawg.fresh and give permissions to dustin.wehr. Then I can load the file from either account and collaborative editing works exactly as I want it to.
At this point, I am working from two different computers for the two accounts, to make sure there isn't some problem caused by insufficiency of using an incognito window.
Any ideas?