I have a drive application wich changes the permissions so another user becomes the owner of the file. After doing this the user get’s an email and the file is listed in all files.
I would like to know how I can change the permissions and put the file in the myDrive.
This is how I add the permissions.
service.permissions().insert(fileId, newPermission).execute();
When a user has permissions on a file it appears in all files,but not in mydrive. How can I make it so the file is also listed in mydrive.
notes:
-The authenticated user is a service account!
-Since I turned notification emails off it doesn’t appear anywhere anymore. But when I search I can find the file and have the correct permissions. It seems that the root of the files don’t get set when changing a permission.
I was adding the parents to the file parentslist and then updated the file.
This is wrong!
Answer: Parents have to be updated seperatly (just like permissions). Now everything is working as expected.
dService.parents().insert(fileId, new ParentReference().setId(iDofLocation)).execute();