1
votes

Is there a way to create or set permissions on a Google Drive folder that allows users to create or upload files to the folder, but not create additional nested folders? Ultimately I would like users to be able to add files to folders, but not change the overall folder structure.

I've been able to set the role of the user for a folder: https://developers.google.com/drive/api/v3/reference/permissions/create

However, once I give "writer" permission to a user they are able to both upload files and create folders.

https://developers.google.com/drive/api/v3/manage-sharing

1
When you say 'not change the overall folder structure', what exactly do you mean? The permissions available on Drive are all linked on the documentation page you linked here developers.google.com/drive/api/v3/manage-sharing#roles. Also will your users be using an application to upload or will they be using the Drive web UI?Rafa Guillermo
I mean not be able to add/remove folders, but still be able to add/edit files in the existing predefined folders. They may use my app to upload, but I'd also like users to be able to work in the Drive directly on the web or through File Stream.Eric Anastas
The footnote below on this page is really a problem: support.google.com/a/answer/7337554 "Contributor access provides read-only access to files in Drive File Stream. Assign the Content manager access level for users who need to edit Drive File Stream files." So there does not appear to be any way to allow people edit files in File Stream, with out also giving them full "Content Manager" access to the DriveEric Anastas
in GDrive, Folders are simply Files with a particular mime-type, so no.pinoyyid
@EricAnastas As pinoyyid mentioned Google Drive isn't a file system in the sense it has folders and directories containing files - everything is a file with a MIME Type and it uses labels and parent IDs to sort files. You can't set it such that users can upload without also giving them write ability to the Drive.Rafa Guillermo

1 Answers

1
votes

Unfortunately, the permission and role functionality combined with the structure of Drive don't allow for the ability to allow users to upload and edit files without also allowing them to change the apparent folder structure of the Drive.

As stated on the Google Drive REST API Documentation about Permission structures in Drives, a file's permission consists of four parameters:

  1. Permission Type (user/group/domain/anyone)
  2. Email Address accociated with the permission
  3. Domain that has access to the permission
  4. Role

There are only 5 assignable roles for file permissions, as can been seen in this table: Assignable permission Roles on Google Drive

Additionally, Google Drive doesn't use a file system, and in actual fact folders in Drive are just files with MIME Type application/vnd.google-apps.folder. You can see this by querying the MIME Type of a folder ID or on the Drive Supported MIME Types reference.