Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save abdiasriver/03e5fa2d210b88d7bb3441ea10cd2e81 to your computer and use it in GitHub Desktop.
Save abdiasriver/03e5fa2d210b88d7bb3441ea10cd2e81 to your computer and use it in GitHub Desktop.
function showpermisssions() {
var folder = DriveApp.getFolderById("IDCARPETA");
var files = folder.getFiles();
while (files.hasNext()) {
// Print list of files inside the folder
file = files.next().getId();
var id = DriveApp.getFileById(file);
try {
// var folacc = folid.getSharingAccess();
// var folperm = folid.getSharingPermission();
var access = id.getSharingAccess();
var permission = id.getSharingPermission();
var viewers = file.getViewers();
var editors = file.getEditors();
// Logger.log(id);
}
catch (e) {Logger.log(id); Logger.log(access);Logger.log(permission);};
// Recursive call for any sub-folders
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment