mirror of
https://github.com/GAM-team/GAM.git
synced 2025-07-10 14:43:34 +00:00
Three updates (#1421)
* Initialize pageToken for each namespace * Update group sync to do removes before adds This gets around problem when a group contains a primary address and a sync is performed with an alias. With adds first you get a duplicate error; with removes first the primary address in the group is replaced with the alias. * Add defaultsender to group settings
This commit is contained in:
@ -720,6 +720,7 @@ Specify a collection of Users by directly specifying them or by specifiying item
|
|||||||
(customfootertext <String>)|
|
(customfootertext <String>)|
|
||||||
(customreplyto <EmailAddress>)|
|
(customreplyto <EmailAddress>)|
|
||||||
(defaultmessagedenynotificationtext <String>)|
|
(defaultmessagedenynotificationtext <String>)|
|
||||||
|
(defaultsender default_self|group)|
|
||||||
(description <String>)|
|
(description <String>)|
|
||||||
(enablecollaborativeinbox|collaborative <Boolean>)|
|
(enablecollaborativeinbox|collaborative <Boolean>)|
|
||||||
(includeinglobaladdresslist|gal <Boolean>)|
|
(includeinglobaladdresslist|gal <Boolean>)|
|
||||||
|
@ -86,6 +86,7 @@ def printshow_policies():
|
|||||||
for namespace in namespaces:
|
for namespace in namespaces:
|
||||||
spacing = ' '
|
spacing = ' '
|
||||||
body['policySchemaFilter'] = f'{namespace}.*'
|
body['policySchemaFilter'] = f'{namespace}.*'
|
||||||
|
body['pageToken'] = None
|
||||||
try:
|
try:
|
||||||
policies = gapi.get_all_pages(svc.customers().policies(), 'resolve',
|
policies = gapi.get_all_pages(svc.customers().policies(), 'resolve',
|
||||||
items='resolvedPolicies',
|
items='resolvedPolicies',
|
||||||
|
@ -266,6 +266,8 @@ GROUP_ATTRIBUTES_ARGUMENT_TO_PROPERTY_MAP = {
|
|||||||
'customReplyTo',
|
'customReplyTo',
|
||||||
'defaultmessagedenynotificationtext':
|
'defaultmessagedenynotificationtext':
|
||||||
'defaultMessageDenyNotificationText',
|
'defaultMessageDenyNotificationText',
|
||||||
|
'defaultsender':
|
||||||
|
'defaultSender',
|
||||||
'enablecollaborativeinbox':
|
'enablecollaborativeinbox':
|
||||||
'enableCollaborativeInbox',
|
'enableCollaborativeInbox',
|
||||||
'favoriterepliesontop':
|
'favoriterepliesontop':
|
||||||
@ -979,6 +981,9 @@ def update():
|
|||||||
sys.stderr.write(
|
sys.stderr.write(
|
||||||
f'Group: {group}, Will add {len(to_add)} and remove {len(to_remove)} {role}s.\n'
|
f'Group: {group}, Will add {len(to_add)} and remove {len(to_remove)} {role}s.\n'
|
||||||
)
|
)
|
||||||
|
for user in to_remove:
|
||||||
|
items.append(
|
||||||
|
['gam', 'update', 'group', group, 'remove', user])
|
||||||
for user in to_add:
|
for user in to_add:
|
||||||
item = ['gam', 'update', 'group', group, 'add']
|
item = ['gam', 'update', 'group', group, 'add']
|
||||||
if role:
|
if role:
|
||||||
@ -987,9 +992,6 @@ def update():
|
|||||||
item.append(delivery)
|
item.append(delivery)
|
||||||
item.append(user)
|
item.append(user)
|
||||||
items.append(item)
|
items.append(item)
|
||||||
for user in to_remove:
|
|
||||||
items.append(
|
|
||||||
['gam', 'update', 'group', group, 'remove', user])
|
|
||||||
elif myarg in ['delete', 'remove']:
|
elif myarg in ['delete', 'remove']:
|
||||||
_, users_email, _ = _getRoleAndUsers()
|
_, users_email, _ = _getRoleAndUsers()
|
||||||
if not exists(cd, group):
|
if not exists(cd, group):
|
||||||
@ -1219,7 +1221,7 @@ def getGroupAttrValue(myarg, value, gs_object, gs_body, function):
|
|||||||
params) in list(gs_object['schemas']['Groups']['properties'].items()):
|
params) in list(gs_object['schemas']['Groups']['properties'].items()):
|
||||||
if attrib in ['kind', 'etag', 'email']:
|
if attrib in ['kind', 'etag', 'email']:
|
||||||
continue
|
continue
|
||||||
if myarg == attrib.lower():
|
if myarg == attrib.lower().replace('_', ''):
|
||||||
if params['type'] == 'integer':
|
if params['type'] == 'integer':
|
||||||
try:
|
try:
|
||||||
if value[-1:].upper() == 'M':
|
if value[-1:].upper() == 'M':
|
||||||
|
@ -1110,7 +1110,8 @@ GROUP_SETTINGS_LIST_ATTRIBUTES = set([
|
|||||||
'whoCanUnmarkFavoriteReplyOnAnyTopic',
|
'whoCanUnmarkFavoriteReplyOnAnyTopic',
|
||||||
'whoCanViewGroup',
|
'whoCanViewGroup',
|
||||||
'whoCanViewMembership',
|
'whoCanViewMembership',
|
||||||
# Miscellaneous hoices
|
# Miscellaneous choices
|
||||||
|
'default_sender',
|
||||||
'messageModerationLevel',
|
'messageModerationLevel',
|
||||||
'replyTo',
|
'replyTo',
|
||||||
'spamModerationLevel',
|
'spamModerationLevel',
|
||||||
|
Reference in New Issue
Block a user