How to add a Google Drive folder to “My Drive” section to other users

前端 未结 3 694
终归单人心
终归单人心 2020-12-16 08:10

I have a Google Drive herarchichal folder and subfolders structure owned by me and I want to add it to the \"My Drive\" section in all users in our Google Apps for Business

3条回答
  •  时光取名叫无心
    2020-12-16 08:43

    First, set up a simple web app. The Google App Script editor even has a template that gets you most of the way there.

    Second, implement something like the following and call it from the handler function.

    function addRequiredFolders() {
      var root = DocsList.getRootFolder();
      var folderIds = ["somefolderid", "anotherfolderid"];
      folderIds.map( function(id) { DocsList.getFolderById(id).addToFolder(root) } );
    }
    

    I've tested a variant of this up to this point. The next step is to publish the Web App for your domain, and email it out to people or otherwise distribute it. I assume they will have the unpleasant step of needing to grant the web app permission to access their documents.

提交回复
热议问题