Reputation: 341
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
Reputation: 4560
Following a quick check of the AODocs documentation, here is what I advise you:
AODocs also has a forum about custom script questions (you need to be signed into the support platform):
Hope it helps.
Upvotes: 1
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