From 2db54fc67add7dff17bfcacfb77c221fb49d5160 Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Wed, 13 May 2020 10:53:36 -0700 Subject: [PATCH 1/2] expirationTime on ACL must be set in an update (#1189) --- src/gam/__init__.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 05c909a4..4705f874 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -3832,6 +3832,7 @@ DRIVEFILE_ACL_ROLES_MAP = { def addDriveFileACL(users): fileId = sys.argv[5] body = {'type': sys.argv[6].lower()} + ubody = {} sendNotificationEmail = False emailMessage = None transferOwnership = None @@ -3865,6 +3866,7 @@ def addDriveFileACL(users): if body['role'] == 'owner': sendNotificationEmail = True transferOwnership = True + ubody['role'] = body['role'] i += 2 elif myarg == 'sendemail': sendNotificationEmail = True @@ -3874,7 +3876,7 @@ def addDriveFileACL(users): emailMessage = sys.argv[i + 1] i += 2 elif myarg == 'expires': - body['expirationTime'] = utils.get_time_or_delta_from_now( + ubody['expirationTime'] = utils.get_time_or_delta_from_now( sys.argv[i + 1]) i += 2 elif myarg == 'asadmin': @@ -3897,6 +3899,17 @@ def addDriveFileACL(users): supportsAllDrives=True, transferOwnership=transferOwnership, useDomainAdminAccess=useDomainAdminAccess) + if 'expirationTime' in ubody: + result = gapi.call(drive.permissions(), + 'update', + fields='*', + fileId=fileId, + permissionId=result['id'], + removeExpiration=False, + transferOwnership=False, + body=ubody, + supportsAllDrives=True, + useDomainAdminAccess=useDomainAdminAccess) printPermission(result) From 6132c038939e2492dbbf448fa9d6875518264878 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Thu, 14 May 2020 07:17:22 -0400 Subject: [PATCH 2/2] Update .travis.yml --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index deee1c02..78496289 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,8 @@ dist: xenial env: global: - - BUILD_PYTHON_VERSION=3.8.2 - - MIN_PYTHON_VERSION=3.8.2 + - BUILD_PYTHON_VERSION=3.8.3 + - MIN_PYTHON_VERSION=3.8.3 - BUILD_OPENSSL_VERSION=1.1.1g - MIN_OPENSSL_VERSION=1.1.1g - PATCHELF_VERSION=0.10