I\'m writting a script in Google Aps (GAS) and I need to add a user(/writer) (administrator of the domain) to a spreadsheed of a another user.
The script is running/
I would never have found this. Thank you very much.
I modified the following (var url = ...):
'user@yourdomain.com/private/full/'
by
user + '/private/full/'
where
user = Session.getActiveUser (). getUserLoginId ()
and also in the googleOAuth_
I put my domain values:
oAuthConfig.setConsumerKey ("mydomain.com");
oAuthConfig.setConsumerSecret ("xXxXxXxXxXxXxXxXx");
And it works perfectly!
I think it's very interesting that administrator of a domain can act on behalf of a user (once we have given permission) with some of the documents of the organization but have been created by the user.
Also user resources (docs, spreadsheet, ...) so that a program can access (running with administrator permissions) without requiring the attention (or you do not have enough expertise) of the user, such as copies of security, ...
In my case, I make a program to evaluate a Google Docs form has been created by a user (a teacher) as does the gadget "Flubaroo" but in a graphical environment (GUI) programmed by Google Sites with Google Apps Script (GAS).
Thanks again for your time.
Sergi