Reputation: 131
I was using an App Script Project to automate the creation of some accounts and profiles inside of our organization. I had been using this same method for adding the "Viewer" permission for the user I would like on the designated shared drive.
DriveApp.getFolderById("My_Dr!v3").addViewer(email);
However, within the past couple days, I suddenly do not have access.
Like I stated before, I had been using this method and service for a decent bit of time but at the beginning of this week noticed this error. I have the service attached to the App Script project and have the Drive API enabled within the Google Cloud Project that is the container for App Scripts. Would there potentially be a setting that someone might have changed that is causing this? Anyone else have a similar experience to this?
I do have the OAuth2 Service enabled within the App Script project if that affects anything
Reference
Google Drive Folder Doc - https://developers.google.com/apps-script/reference/drive/folder
Google DriveApp Doc - https://developers.google.com/apps-script/reference/drive/drive-app
Upvotes: 1
Views: 205
Reputation: 2426
It looks like the problem is the type of access level you have in the shared drive.
The Content manager
access level is not enough to perform this type of action as I was able to reproduce the exact same error message from the screenshot provided:
However, if I change myself as a Manager
, which is the highest access level I no longer get the error message:
Upvotes: 1