mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-03 22:01:39 +00:00
Added option oneitemperrow to gam <UserTypeEntity> print calendars ... permissions
This commit is contained in:
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
||||
"""
|
||||
|
||||
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
||||
__version__ = '7.29.00'
|
||||
__version__ = '7.29.01'
|
||||
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
||||
|
||||
#pylint: disable=wrong-import-position
|
||||
@@ -53051,7 +53051,7 @@ CALENDAR_EXCLUDE_DOMAINS = {
|
||||
|
||||
# gam <UserTypeEntity> print calendars <UserCalendarEntity> [todrive <ToDriveAttribute>*]
|
||||
# [primary] <CalendarSelectProperty>* [noprimary] [nogroups] [noresources] [nosystem] [nousers]
|
||||
# [fields <CalendarFieldList>] [permissions]
|
||||
# [fields <CalendarFieldList>] [permissions] [oneitemperrow]
|
||||
# [formatjson [quotechar <Character>]] [delimiter <Character>]
|
||||
# gam <UserTypeEntity> show calendars <UserCalendarEntity>
|
||||
# [primary] <CalendarSelectProperty>* [noprimary] [nogroups] [noresources] [nosystem] [nousers]
|
||||
@@ -53059,7 +53059,7 @@ CALENDAR_EXCLUDE_DOMAINS = {
|
||||
# [formatjson]
|
||||
def printShowCalendars(users):
|
||||
acls = []
|
||||
getCalPermissions = noPrimary = primaryOnly = False
|
||||
getCalPermissions = oneItemPerRow = noPrimary = primaryOnly = False
|
||||
excludes = set()
|
||||
excludeDomains = set()
|
||||
csvPF = CSVPrintFile(['primaryEmail', 'calendarId'], 'sortall') if Act.csvFormat() else None
|
||||
@@ -53073,6 +53073,8 @@ def printShowCalendars(users):
|
||||
csvPF.GetTodriveParameters()
|
||||
elif myarg in [Cmd.ARG_ACLS, Cmd.ARG_CALENDARACLS, Cmd.ARG_PERMISSIONS]:
|
||||
getCalPermissions = True
|
||||
elif myarg == 'oneitemperrow':
|
||||
oneItemPerRow = True
|
||||
elif myarg == 'allcalendars':
|
||||
pass
|
||||
elif myarg == 'primary':
|
||||
@@ -53148,17 +53150,35 @@ def printShowCalendars(users):
|
||||
Ind.Decrement()
|
||||
else:
|
||||
if calendars:
|
||||
for calendar in calendars:
|
||||
row = {'primaryEmail': user, 'calendarId': calendar['id']}
|
||||
if getCalPermissions:
|
||||
flattenJSON({'permissions': _getCalendarPermissions(cal, calendar)}, flattened=row)
|
||||
flattenJSON(calendar, flattened=row, simpleLists=CALENDAR_SIMPLE_LISTS, delimiter=delimiter)
|
||||
if not FJQC.formatJSON:
|
||||
row.pop('id')
|
||||
csvPF.WriteRowTitles(row)
|
||||
elif csvPF.CheckRowTitles(row):
|
||||
csvPF.WriteRowNoFilter({'primaryEmail': user, 'calendarId': calendar['id'],
|
||||
'JSON': json.dumps(cleanJSON(calendar), ensure_ascii=False, sort_keys=True)})
|
||||
if not getCalPermissions or not oneItemPerRow:
|
||||
for calendar in calendars:
|
||||
row = {'primaryEmail': user, 'calendarId': calendar['id']}
|
||||
if getCalPermissions:
|
||||
calPerms = _getCalendarPermissions(cal, calendar)
|
||||
flattenJSON({'permissions': calPerms}, flattened=row)
|
||||
flattenJSON(calendar, flattened=row, simpleLists=CALENDAR_SIMPLE_LISTS, delimiter=delimiter)
|
||||
if not FJQC.formatJSON:
|
||||
row.pop('id')
|
||||
csvPF.WriteRowTitles(row)
|
||||
elif csvPF.CheckRowTitles(row):
|
||||
if getCalPermissions:
|
||||
calendar.update({'permissions': calPerms})
|
||||
csvPF.WriteRowNoFilter({'primaryEmail': user, 'calendarId': calendar['id'],
|
||||
'JSON': json.dumps(cleanJSON(calendar), ensure_ascii=False, sort_keys=True)})
|
||||
else:
|
||||
for calendar in calendars:
|
||||
baserow = {'primaryEmail': user, 'calendarId': calendar['id']}
|
||||
flattenJSON(calendar, flattened=baserow, simpleLists=CALENDAR_SIMPLE_LISTS, delimiter=delimiter)
|
||||
for permission in _getCalendarPermissions(cal, calendar):
|
||||
row = baserow.copy()
|
||||
flattenJSON({'permission': permission}, flattened=row)
|
||||
if not FJQC.formatJSON:
|
||||
row.pop('id')
|
||||
csvPF.WriteRowTitles(row)
|
||||
elif csvPF.CheckRowTitles(row):
|
||||
calendar.update({'permission': permission})
|
||||
csvPF.WriteRowNoFilter({'primaryEmail': user, 'calendarId': calendar['id'],
|
||||
'JSON': json.dumps(cleanJSON(calendar), ensure_ascii=False, sort_keys=True)})
|
||||
elif GC.Values[GC.CSV_OUTPUT_USERS_AUDIT]:
|
||||
csvPF.WriteRowNoFilter({'primaryEmail': user})
|
||||
if csvPF:
|
||||
@@ -53630,7 +53650,7 @@ def emptyCalendarTrash(users):
|
||||
|
||||
# gam <UserTypeEntity> update calattendees <UserCalendarEntity> <EventEntity> [anyorganizer]
|
||||
# [<EventNotificationAttribute>] [splitupdate] [doit]
|
||||
# (<CSVFileSelector>)
|
||||
# (csv|csvfile <CSVFileInput> endcsv)
|
||||
# (delete <EmailAddress>)*
|
||||
# (deleteentity <EmailAddressEntity>)*
|
||||
# (add <EmailAddress>)*
|
||||
|
||||
@@ -10,6 +10,11 @@ Add the `-s` option to the end of the above commands to suppress creating the `g
|
||||
|
||||
See [Downloads-Installs-GAM7](https://github.com/GAM-team/GAM/wiki/Downloads-Installs) for Windows or other options, including manual installation
|
||||
|
||||
### 7.29.01
|
||||
|
||||
Added option `oneitemperrow` to `gam <UserTypeEntity> print calendars ... permissions` to have each of a
|
||||
calendar's permissions displayed on a separate row with all of the other calendar fields.
|
||||
|
||||
### 7.29.00
|
||||
|
||||
Added options `mappermissionsemail <EmailAddress> <EmailAddress>` and ` mappermissionsemailfile <CSVFileInput> endcsv`
|
||||
|
||||
Reference in New Issue
Block a user