I have a realtime app and get the collaborators with doc.getCollaborators()
and this gives me an array [] doc
is from the type gapi.drive.realtime.Document
:
According to the API Reference there is no field like isOwner
that shows me if the current collaborator is the owner of the realtime document "doc
"
My Question how can I find out which role the collaborators of a doc
has.
In the API documentation I find: "The Realtime API supports owner, reader and writer roles"
If I try to use gapi.client.drive.permissions.list
suggested from the google drive api reference:
function retrievePermissions(fileId, callback) {
var request = gapi.client.drive.permissions.list({
'fileId': fileId
});
request.execute(function (resp) {
callback(resp.items);
});
}
retrievePermissions(self.realtimeDocId, function (resp) {
resp;
});
Then I get the following error message:
Error in Realtime load callback: TypeError: Cannot read property 'permissions' of undefined TypeError: Cannot read property 'permissions' of undefined