From 1cfd7ec10275d4858634ad056f1bdc1a5fc48f87 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 15 Jan 2014 10:35:28 +0100 Subject: [PATCH] [FIX] google_drive: anyone with the link can now write We used to give write access to the email address of the current user, but if the email is not a google account, there is no way for the current user to write on the data (except if the current email address is also the email which has done the oauth activation in the settings). bzr revid: dle@openerp.com-20140115093528-ir39ppqrinjqyeta --- addons/google_drive/google_drive.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/google_drive/google_drive.py b/addons/google_drive/google_drive.py index b69c7ddd173..f3607094040 100644 --- a/addons/google_drive/google_drive.py +++ b/addons/google_drive/google_drive.py @@ -120,7 +120,7 @@ class config(osv.Model): res['url'] = content['alternateLink'] key = self._get_key_from_url(res['url']) request_url = "https://www.googleapis.com/drive/v2/files/%s/permissions?emailMessage=This+is+a+drive+file+created+by+OpenERP&sendNotificationEmails=false&access_token=%s" % (key, access_token) - data = {'role': 'reader', 'type': 'anyone', 'value': '', 'withLink': True} + data = {'role': 'writer', 'type': 'anyone', 'value': '', 'withLink': True} try: req = urllib2.Request(request_url, json.dumps(data), headers) urllib2.urlopen(req) @@ -133,7 +133,7 @@ class config(osv.Model): req = urllib2.Request(request_url, json.dumps(data), headers) urllib2.urlopen(req) except urllib2.HTTPError: - raise self.pool.get('res.config.settings').get_config_warning(cr, _("The permission 'writer' for your email '%s' has not been written on the document. Is this email a valid Google Account ?" % user.email), context=context) + pass return res def get_google_drive_config(self, cr, uid, res_model, res_id, context=None):