简体   繁体   中英

Can I change permission of a folder and move it programmatically using Apps Script (G-Suite)?

I want to implement G-Suite within my app and I was wondering if I could change permission of a folder and move it programmatically using Apps Script? I also wonder if I can export files and folders from Google G-Suite from within my app programmatically!

setSharing(accessType, permissionType) from the Folder Class may be able to help you. There are also other methods related to permission.

setSharing(accessType, permissionType)

Sets which class of users can access the Folder and what permissions those users are granted, besides any individual users who have been explicitly given access.

// Creates a folder that anyone on the Internet can read from and write to. (Domain // administrators can prohibit this setting for users of a G Suite domain.) var folder = DriveApp.createFolder('Shared Folder'); folder.setSharing(DriveApp.Access.ANYONE, DriveApp.Permission.EDIT);

With regard to moving files in a folder in Apps Script, check this Move Files to Another Folder with Google Scripts guide.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM