Fix calendar add ACL (#465)

This commit is contained in:
Ross Scroggs
2017-03-31 10:27:49 -07:00
committed by Jay Lee
parent 1e013e6cd7
commit 6160bb0953

View File

@ -2981,6 +2981,10 @@ def doCalendarShowACL():
print u'Calendar: {0}, ACL: {1}{2}'.format(show_cal, formatACLRule(rule), currentCount(i, count))
def doCalendarAddACL(calendarId=None, act_as=None, role=None, scope=None, entity=None):
if calendarId is None:
calendarId = sys.argv[2]
if calendarId.find(u'@') == -1:
calendarId = u'%s@%s' % (calendarId, GC_Values[GC_DOMAIN])
if not act_as:
act_as = calendarId
_, cal = buildCalendarGAPIObject(act_as)
@ -2991,10 +2995,6 @@ def doCalendarAddACL(calendarId=None, act_as=None, role=None, scope=None, entity
except oauth2client.client.HttpAccessTokenRefreshError:
_, cal = buildCalendarGAPIObject(_getAdminUserFromOAuth())
body = {u'scope': {}}
if calendarId is None:
calendarId = sys.argv[2]
if calendarId.find(u'@') == -1:
calendarId = u'%s@%s' % (calendarId, GC_Values[GC_DOMAIN])
if role is not None:
body[u'role'] = role
else: