How can I force all files in a folder to be owned by the folder owner in Google Drive?

自古美人都是妖i 提交于 2021-01-27 13:11:54

问题


I have several people contributing files to various folders in Google Drive. Each folder is for a specific project, and has an owner account named to match that project title. I want every file (and its descendants) in that parent folder to be owned by that project account. Eg the folder is called "Conferences", and is owned by the user "conferences.events@mydomain.com". All files uploaded/created into Conferences should be owned by the "conferences.events" account.

What is the easiest way to automate this (I've looked for scripts online), and can someone provide a working example? Thanks.


回答1:


Short answer

The only way "to force" files in folder be owned by the folder owner is that the the other users only have view access to it.

Explanation

If users are able to add files to a folder there is no way to avoid that they add files that are owned by other then the folder owner user.

Workarounds

Instead of allowing users to directly contribute to files to folders, implement other way to add the files to that folder. There are several alternatives:

  1. Use Google Forms. Google recently added a upload file to Google Forms. It's only available to G Suite users. Reference: Edit form, article from Google Docs Editors Help

  2. Create a Google Apps Script Web App. A Web App could create a copy of the a file selected by the user or even it could change the file owner.

    • Reference: Transfer ownership of a file to another user in Google Apps Script Q&A from Stack Overflow
  3. Create an app using Google Drive API

    • Reference: Transfer Drive files to a new owner, article from the G Suite Administrators Help


来源:https://stackoverflow.com/questions/21892358/how-can-i-force-all-files-in-a-folder-to-be-owned-by-the-folder-owner-in-google

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!