Taum
Taum

Reputation: 341

Can I write a script on AODocs to automatically change the permission on folders?

I am using AODocs for company work and we would like to be able to lock folders that are not relevant anymore, without having to delete them in case we need specific information later. However, leaving them open might let people add things inside we dont want. I know it isn't possible to lock folders individually in AODocs but that you have to use the permissions.

Doing this all by hand knowing we have over 70 folders per month to close would be a tall task to ask anybody to do. Therefore I wanted to know if it was possible to create a script that automatically changes the permission on folders that are selected?

Upvotes: 0

Views: 1456

Answers (2)

rd3n
rd3n

Reputation: 4560

Following a quick check of the AODocs documentation, here is what I advise you:

  • You will need to set up your library in flexible permissions and run a script to force the folder (and its content) to be in read-only when you decide it.
  • You cannot "tag" folders to know which ones to lock, so you should perhaps use a tag in the name of the folder like "[locked]".

AODocs also has a forum about custom script questions (you need to be signed into the support platform):

  • AODocs team and engineering are closely watching this community.
  • Custom script documentation is not publicly published but you can surely request access there.

Hope it helps.

Upvotes: 1

user8326252
user8326252

Reputation: 11

I suggest you use a Google Apps Script to develop something like that. If you create an Apps Script doc on your Drive, you can manage all of the folders you want. Try this script:

function myFunction() {
  
  //take all folders in Drive
  var folders = DriveApp.getFolders();
  //loop on folders
  while (folders.hasNext()) {
     //take the current folder
     var folder = folders.next();
     Logger.log(folder.getName());
    
     /*I take all editors, but it's possible to take even all viewers inserting var users = folder.getViewers();*/
     var users = folder.getEditors();
     
     //loop on users    
     for(var i=0; i<users.length;i++) {
       //revoke all permissions to current user
       folder= folder.revokePermissions(users[i]);
     }
  }
}

The result is: all editors are removed. Furthermore, it's possible to schedule the script execution, creating a trigger

**N.B.**This method does not block users from accessing the Folder if they belong to a class of users who have general access — for example, if the Folder is shared with the user's entire domain.

Upvotes: 1

Related Questions