GithubHelp home page GithubHelp logo

moya-a / g-drive-sharedfiles-checker Goto Github PK

View Code? Open in Web Editor NEW
28.0 28.0 6.0 13 KB

Check your GoogleDrive to find all your shared files

License: MIT License

JavaScript 100.00%
file-sharing finder google-apps-script google-drive script

g-drive-sharedfiles-checker's People

Contributors

moya-a avatar qwickening avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

g-drive-sharedfiles-checker's Issues

access permission error

Hi,

The problem of "Exception: The file or folder has invalid access settings." can be very strange.

Your current approach attempts to collect every file's permission within a list called resultFiles before writing to a google sheet. Due to this any errors encountered during a particular folder or a file cannot be debugged easily. Any successfully evaluated folders and files are lost.

It would be worthwhile to instead append each row to the sheet. This would also prevent any timeout errors and internet connection problems while spooling resultFiles.

Please have a look at appendRow function of this gist that recursively goes through folders and subfolders - https://gist.github.com/JavierCane/28f7307ceeaf6464431c1418b598a817

Google changed the access permission methods at some point in the past. Prior to that a complex set of link sharing options could be assigned to a file or a folder. So some files and folders in a drive can have those older settings for access sharing and permissions, which are not a part of the current API.

In one of the folders that had this exception I found multiple share link settings in its share menu. I manually found that using the GUI after using the following code.

function start() {
  var folders = DriveApp.searchFolders('not "me" in owners');
  while (folders.hasNext()) {
    var folder = folders.next();
    try {
      if (folder.getSharingAccess() === DriveApp.Access.ANYONE) {
        Logger.log(folder.getName());
      }
    }
    catch(err) {
      Logger.log(folder.getName());
      Logger.log(err);
    }
  }
}

Please let me know if you are able to come up with a way to append each row to a sheet instead of collecting each row in a list. I wasn't able to do it myself to submit a pull request or a fork because I don't understand the logic for comparing the sharing access strings and sharing permissions strings in your current method.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.