mirror of
https://github.com/GAM-team/GAM.git
synced 2025-07-04 11:43:45 +00:00
Added option addcsvdata <FieldName> <String>
to gam print cros
This commit is contained in:
@ -551,6 +551,7 @@ gam print cros [todrive <ToDriveAttribute>*]
|
|||||||
[start <Date>] [end <Date>] [listlimit <Number>]
|
[start <Date>] [end <Date>] [listlimit <Number>]
|
||||||
[reverselists <CrOSListFieldNameList>]
|
[reverselists <CrOSListFieldNameList>]
|
||||||
[timerangeorder ascending|descending] [showdvrsfp]
|
[timerangeorder ascending|descending] [showdvrsfp]
|
||||||
|
(addcsvdata <FieldName> <String>)*
|
||||||
[sortheaders]
|
[sortheaders]
|
||||||
[formatjson [quotechar <Character>]]
|
[formatjson [quotechar <Character>]]
|
||||||
```
|
```
|
||||||
@ -593,6 +594,9 @@ otherwise, the remaining field names will appear in the order specified.
|
|||||||
- `timerangeorder descending` - Change the `activetimeranges` order from ascending (oldest to newest) to descending (newest to oldest); this makes it easy to get the `N` most recent values with `timeranges listlimit N timerangeorder descending`.
|
- `timerangeorder descending` - Change the `activetimeranges` order from ascending (oldest to newest) to descending (newest to oldest); this makes it easy to get the `N` most recent values with `timeranges listlimit N timerangeorder descending`.
|
||||||
- `showdvrsfp` - Display a field `diskVolumeReports.volumeInfo.storageFreePercentage` which is calculated as: `(diskVolumeReports.volumeInfo.storageFree/diskVolumeReports.volumeInfo.storageTotal)*100`
|
- `showdvrsfp` - Display a field `diskVolumeReports.volumeInfo.storageFreePercentage` which is calculated as: `(diskVolumeReports.volumeInfo.storageFree/diskVolumeReports.volumeInfo.storageTotal)*100`
|
||||||
|
|
||||||
|
Add additional columns of data from the command line to the output
|
||||||
|
* `addcsvdata <FieldName> <String>`
|
||||||
|
|
||||||
By default, Gam displays the information as columns of fields; the following option causes the output to be in JSON format:
|
By default, Gam displays the information as columns of fields; the following option causes the output to be in JSON format:
|
||||||
|
|
||||||
- `formatjson` - Display the fields in JSON format.
|
- `formatjson` - Display the fields in JSON format.
|
||||||
@ -615,6 +619,7 @@ gam <CrOSTypeEntity> print cros [todrive <ToDriveAttribute>*]
|
|||||||
[start <Date>] [end <Date>] [listlimit <Number>]
|
[start <Date>] [end <Date>] [listlimit <Number>]
|
||||||
[reverselists <CrOSListFieldNameList>]
|
[reverselists <CrOSListFieldNameList>]
|
||||||
[timerangeorder ascending|descending] [showdvrsfp]
|
[timerangeorder ascending|descending] [showdvrsfp]
|
||||||
|
(addcsvdata <FieldName> <String>)*
|
||||||
[sortheaders]
|
[sortheaders]
|
||||||
[formatjson [quotechar <Character>]]
|
[formatjson [quotechar <Character>]]
|
||||||
|
|
||||||
@ -643,6 +648,9 @@ otherwise, the remaining field names will appear in the order specified.
|
|||||||
- `timerangeorder descending` - Change the `activetimeranges` order from ascending (oldest to newest) to descending (newest to oldest); this makes it easy to get the `N` most recent values with `timeranges listlimit N timerangeorder descending`.
|
- `timerangeorder descending` - Change the `activetimeranges` order from ascending (oldest to newest) to descending (newest to oldest); this makes it easy to get the `N` most recent values with `timeranges listlimit N timerangeorder descending`.
|
||||||
- `showdvrsfp` - Display a field `diskVolumeReports.volumeInfo.storageFreePercentage` which is calculated as: `(diskVolumeReports.volumeInfo.storageFree/diskVolumeReports.volumeInfo.storageTotal)*100`
|
- `showdvrsfp` - Display a field `diskVolumeReports.volumeInfo.storageFreePercentage` which is calculated as: `(diskVolumeReports.volumeInfo.storageFree/diskVolumeReports.volumeInfo.storageTotal)*100`
|
||||||
|
|
||||||
|
Add additional columns of data from the command line to the output
|
||||||
|
* `addcsvdata <FieldName> <String>`
|
||||||
|
|
||||||
By default, Gam displays the information as columns of fields; the following option causes the output to be in JSON format:
|
By default, Gam displays the information as columns of fields; the following option causes the output to be in JSON format:
|
||||||
|
|
||||||
- `formatjson` - Display the fields in JSON format.
|
- `formatjson` - Display the fields in JSON format.
|
||||||
|
@ -10,6 +10,12 @@ Add the `-s` option to the end of the above commands to suppress creating the `g
|
|||||||
|
|
||||||
See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation
|
See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation
|
||||||
|
|
||||||
|
### 6.71.11
|
||||||
|
|
||||||
|
Added option `addcsvdata <FieldName> <String>` to `gam print cros` that adds
|
||||||
|
additional columns of data to the CSV file output. Typically, you would read CSV file of device IDs/serial numbers
|
||||||
|
to generate a CSV file of results and copy data from the input CSV to the outout CSV.
|
||||||
|
|
||||||
### 6.71.10
|
### 6.71.10
|
||||||
|
|
||||||
Reverted change made in 6.71.09 to `gam <UserTypeEntity> print filelist` when `showmimetype` and `filepath|fullpath`
|
Reverted change made in 6.71.09 to `gam <UserTypeEntity> print filelist` when `showmimetype` and `filepath|fullpath`
|
||||||
|
@ -334,7 +334,7 @@ writes the credentials into the file oauth2.txt.
|
|||||||
admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt
|
admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt
|
||||||
admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version
|
admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version
|
||||||
WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
|
WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
|
||||||
GAMADV-XTD3 6.71.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.71.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.2 64-bit final
|
Python 3.12.2 64-bit final
|
||||||
MacOS Sonoma 14.2.1 x86_64
|
MacOS Sonoma 14.2.1 x86_64
|
||||||
@ -1006,7 +1006,7 @@ writes the credentials into the file oauth2.txt.
|
|||||||
C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt
|
C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt
|
||||||
C:\GAMADV-XTD3>gam version
|
C:\GAMADV-XTD3>gam version
|
||||||
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
|
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
|
||||||
GAMADV-XTD3 6.71.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.71.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.2 64-bit final
|
Python 3.12.2 64-bit final
|
||||||
Windows-10-10.0.17134 AMD64
|
Windows-10-10.0.17134 AMD64
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
Print the current version of Gam with details
|
Print the current version of Gam with details
|
||||||
```
|
```
|
||||||
gam version
|
gam version
|
||||||
GAMADV-XTD3 6.71.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.71.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.2 64-bit final
|
Python 3.12.2 64-bit final
|
||||||
MacOS Sonoma 14.2.1 x86_64
|
MacOS Sonoma 14.2.1 x86_64
|
||||||
@ -15,7 +15,7 @@ Time: 2023-06-02T21:10:00-07:00
|
|||||||
Print the current version of Gam with details and time offset information
|
Print the current version of Gam with details and time offset information
|
||||||
```
|
```
|
||||||
gam version timeoffset
|
gam version timeoffset
|
||||||
GAMADV-XTD3 6.71.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.71.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.2 64-bit final
|
Python 3.12.2 64-bit final
|
||||||
MacOS Sonoma 14.2.1 x86_64
|
MacOS Sonoma 14.2.1 x86_64
|
||||||
@ -27,7 +27,7 @@ Your system time differs from www.googleapis.com by less than 1 second
|
|||||||
Print the current version of Gam with extended details and SSL information
|
Print the current version of Gam with extended details and SSL information
|
||||||
```
|
```
|
||||||
gam version extended
|
gam version extended
|
||||||
GAMADV-XTD3 6.71.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.71.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.2 64-bit final
|
Python 3.12.2 64-bit final
|
||||||
MacOS Sonoma 14.2.1 x86_64
|
MacOS Sonoma 14.2.1 x86_64
|
||||||
@ -64,7 +64,7 @@ MacOS High Sierra 10.13.6 x86_64
|
|||||||
Path: /Users/Admin/bin/gamadv-xtd3
|
Path: /Users/Admin/bin/gamadv-xtd3
|
||||||
Version Check:
|
Version Check:
|
||||||
Current: 5.35.08
|
Current: 5.35.08
|
||||||
Latest: 6.71.10
|
Latest: 6.71.11
|
||||||
echo $?
|
echo $?
|
||||||
1
|
1
|
||||||
```
|
```
|
||||||
@ -72,7 +72,7 @@ echo $?
|
|||||||
Print the current version number without details
|
Print the current version number without details
|
||||||
```
|
```
|
||||||
gam version simple
|
gam version simple
|
||||||
6.71.10
|
6.71.11
|
||||||
```
|
```
|
||||||
In Linux/MacOS you can do:
|
In Linux/MacOS you can do:
|
||||||
```
|
```
|
||||||
@ -82,7 +82,7 @@ echo $VER
|
|||||||
Print the current version of Gam and address of this Wiki
|
Print the current version of Gam and address of this Wiki
|
||||||
```
|
```
|
||||||
gam help
|
gam help
|
||||||
GAM 6.71.10 - https://github.com/taers232c/GAMADV-XTD3
|
GAM 6.71.11 - https://github.com/taers232c/GAMADV-XTD3
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.2 64-bit final
|
Python 3.12.2 64-bit final
|
||||||
MacOS Sonoma 14.2.1 x86_64
|
MacOS Sonoma 14.2.1 x86_64
|
||||||
|
@ -2309,6 +2309,7 @@ gam print cros [todrive <ToDriveAttribute>*]
|
|||||||
[start <Date>] [end <Date>] [listlimit <Number>]
|
[start <Date>] [end <Date>] [listlimit <Number>]
|
||||||
[reverselists <CrOSListFieldNameList>]
|
[reverselists <CrOSListFieldNameList>]
|
||||||
[timerangeorder ascending|descending] [showdvrsfp]
|
[timerangeorder ascending|descending] [showdvrsfp]
|
||||||
|
(addcsvdata <FieldName> <String>)*
|
||||||
[sortheaders]
|
[sortheaders]
|
||||||
[formatjson [quotechar <Character>]]
|
[formatjson [quotechar <Character>]]
|
||||||
[showitemcountonly]
|
[showitemcountonly]
|
||||||
@ -2333,6 +2334,7 @@ gam <CrOSTypeEntity> print cros [todrive <ToDriveAttribute>*]
|
|||||||
[start <Date>] [end <Date>] [listlimit <Number>]
|
[start <Date>] [end <Date>] [listlimit <Number>]
|
||||||
[reverselists <CrOSListFieldNameList>]
|
[reverselists <CrOSListFieldNameList>]
|
||||||
[timerangeorder ascending|descending] [showdvrsfp]
|
[timerangeorder ascending|descending] [showdvrsfp]
|
||||||
|
(addcsvdata <FieldName> <String>)*
|
||||||
[sortheaders]
|
[sortheaders]
|
||||||
[formatjson [quotechar <Character>]]
|
[formatjson [quotechar <Character>]]
|
||||||
[showitemcountonly]
|
[showitemcountonly]
|
||||||
|
@ -2,6 +2,12 @@
|
|||||||
|
|
||||||
Merged GAM-Team version
|
Merged GAM-Team version
|
||||||
|
|
||||||
|
6.71.11
|
||||||
|
|
||||||
|
Added option `addcsvdata <FieldName> <String>` to `gam print cros` that adds
|
||||||
|
additional columns of data to the CSV file output. Typically, you would read CSV file of device IDs/serial numbers
|
||||||
|
to generate a CSV file of results and copy data from the input CSV to the outout CSV.
|
||||||
|
|
||||||
6.71.10
|
6.71.10
|
||||||
|
|
||||||
Reverted change made in 6.71.09 to `gam <UserTypeEntity> print filelist` when `showmimetype` and `filepath|fullpath`
|
Reverted change made in 6.71.09 to `gam <UserTypeEntity> print filelist` when `showmimetype` and `filepath|fullpath`
|
||||||
|
@ -23649,6 +23649,7 @@ CROS_INDEXED_TITLES = ['activeTimeRanges', 'recentUsers', 'deviceFiles',
|
|||||||
# [start <Date>] [end <Date>] [listlimit <Number>]
|
# [start <Date>] [end <Date>] [listlimit <Number>]
|
||||||
# [reverselists <CrOSListFieldNameList>]
|
# [reverselists <CrOSListFieldNameList>]
|
||||||
# [timerangeorder ascending|descending] [showdvrsfp]
|
# [timerangeorder ascending|descending] [showdvrsfp]
|
||||||
|
# (addcsvdata <FieldName> <String>)*
|
||||||
# [sortheaders]
|
# [sortheaders]
|
||||||
# [formatjson [quotechar <Character>]]
|
# [formatjson [quotechar <Character>]]
|
||||||
# [showitemcountonly]
|
# [showitemcountonly]
|
||||||
@ -23664,6 +23665,8 @@ def doPrintCrOSDevices(entityList=None):
|
|||||||
cros[field].reverse()
|
cros[field].reverse()
|
||||||
if 'orgUnitId' in cros:
|
if 'orgUnitId' in cros:
|
||||||
cros['orgUnitId'] = f"id:{cros['orgUnitId']}"
|
cros['orgUnitId'] = f"id:{cros['orgUnitId']}"
|
||||||
|
if addCSVData:
|
||||||
|
cros.update(addCSVData)
|
||||||
if FJQC.formatJSON:
|
if FJQC.formatJSON:
|
||||||
if (not csvPF.rowFilter and not csvPF.rowDropFilter) or csvPF.CheckRowTitles(flattenJSON(cros, listLimit=listLimit, timeObjects=CROS_TIME_OBJECTS)):
|
if (not csvPF.rowFilter and not csvPF.rowDropFilter) or csvPF.CheckRowTitles(flattenJSON(cros, listLimit=listLimit, timeObjects=CROS_TIME_OBJECTS)):
|
||||||
csvPF.WriteRowNoFilter({'deviceId': cros['deviceId'],
|
csvPF.WriteRowNoFilter({'deviceId': cros['deviceId'],
|
||||||
@ -23703,6 +23706,8 @@ def doPrintCrOSDevices(entityList=None):
|
|||||||
row[attrib] = cros[attrib]
|
row[attrib] = cros[attrib]
|
||||||
else:
|
else:
|
||||||
row[attrib] = formatLocalTime(cros[attrib])
|
row[attrib] = formatLocalTime(cros[attrib])
|
||||||
|
if addCSVData:
|
||||||
|
row.update(addCSVData)
|
||||||
if noLists or (not activeTimeRanges and not recentUsers and not deviceFiles and
|
if noLists or (not activeTimeRanges and not recentUsers and not deviceFiles and
|
||||||
not cpuStatusReports and not diskVolumeReports and not lastKnownNetworks and not screenshotFiles and not systemRamFreeReports):
|
not cpuStatusReports and not diskVolumeReports and not lastKnownNetworks and not screenshotFiles and not systemRamFreeReports):
|
||||||
csvPF.WriteRowTitles(row)
|
csvPF.WriteRowTitles(row)
|
||||||
@ -23787,6 +23792,7 @@ def doPrintCrOSDevices(entityList=None):
|
|||||||
allFields = noLists = oneRow = showDVRstorageFreePercentage = sortHeaders = False
|
allFields = noLists = oneRow = showDVRstorageFreePercentage = sortHeaders = False
|
||||||
activeTimeRangesOrder = 'ASCENDING'
|
activeTimeRangesOrder = 'ASCENDING'
|
||||||
showItemCountOnly = False
|
showItemCountOnly = False
|
||||||
|
addCSVData = {}
|
||||||
while Cmd.ArgumentsRemaining():
|
while Cmd.ArgumentsRemaining():
|
||||||
myarg = getArgument()
|
myarg = getArgument()
|
||||||
if myarg == 'todrive':
|
if myarg == 'todrive':
|
||||||
@ -23858,6 +23864,9 @@ def doPrintCrOSDevices(entityList=None):
|
|||||||
showDVRstorageFreePercentage = True
|
showDVRstorageFreePercentage = True
|
||||||
elif myarg == 'showitemcountonly':
|
elif myarg == 'showitemcountonly':
|
||||||
showItemCountOnly = True
|
showItemCountOnly = True
|
||||||
|
elif csvPF and myarg == 'addcsvdata':
|
||||||
|
k = getString(Cmd.OB_STRING)
|
||||||
|
addCSVData[k] = getString(Cmd.OB_STRING, minLen=0)
|
||||||
else:
|
else:
|
||||||
FJQC.GetFormatJSONQuoteChar(myarg, False)
|
FJQC.GetFormatJSONQuoteChar(myarg, False)
|
||||||
if selectedLists:
|
if selectedLists:
|
||||||
@ -62766,16 +62775,18 @@ SHOW_NO_PERMISSIONS_DRIVES_CHOICE_MAP = {
|
|||||||
# [matchname <RegularExpression>] [orgunit|org|ou <OrgUnitPath>]
|
# [matchname <RegularExpression>] [orgunit|org|ou <OrgUnitPath>]
|
||||||
# [user|group <EmailAddress> [checkgroups]] (role|roles <SharedDriveACLRoleList>)*
|
# [user|group <EmailAddress> [checkgroups]] (role|roles <SharedDriveACLRoleList>)*
|
||||||
# <PermissionMatch>* [<PermissionMatchAction>] [pmselect]
|
# <PermissionMatch>* [<PermissionMatchAction>] [pmselect]
|
||||||
# [oneitemperrow] [<DrivePermissionsFieldName>*|(fields <DrivePermissionsFieldNameList>)]
|
# [oneitemperrow] [maxitems <Integer>]
|
||||||
# [shownopermissionsdrives false|true|only]
|
# [shownopermissionsdrives false|true|only]
|
||||||
|
# [<DrivePermissionsFieldName>*|(fields <DrivePermissionsFieldNameList>)]
|
||||||
# [formatjson [quotechar <Character>]]
|
# [formatjson [quotechar <Character>]]
|
||||||
# gam [<UserTypeEntity>] show shareddriveacls
|
# gam [<UserTypeEntity>] show shareddriveacls
|
||||||
# [adminaccess|asadmin] [shareddriveadminquery|query <QuerySharedDrive>]
|
# [adminaccess|asadmin] [shareddriveadminquery|query <QuerySharedDrive>]
|
||||||
# [matchname <RegularExpression>] [orgunit|org|ou <OrgUnitPath>]
|
# [matchname <RegularExpression>] [orgunit|org|ou <OrgUnitPath>]
|
||||||
# [user|group <EmailAddress> [checkgroups]] (role|roles <SharedDriveACLRoleList>)*
|
# [user|group <EmailAddress> [checkgroups]] (role|roles <SharedDriveACLRoleList>)*
|
||||||
# <PermissionMatch>* [<PermissionMatchAction>] [pmselect]
|
# <PermissionMatch>* [<PermissionMatchAction>] [pmselect]
|
||||||
# [oneitemperrow] [<DrivePermissionsFieldName>*|(fields <DrivePermissionsFieldNameList>)]
|
# [oneitemperrow] [maxitems <Integer>]
|
||||||
# [shownopermissionsdrives false|true|only]
|
# [shownopermissionsdrives false|true|only]
|
||||||
|
# [<DrivePermissionsFieldName>*|(fields <DrivePermissionsFieldNameList>)]
|
||||||
# [formatjsn]
|
# [formatjsn]
|
||||||
def printShowSharedDriveACLs(users, useDomainAdminAccess=False):
|
def printShowSharedDriveACLs(users, useDomainAdminAccess=False):
|
||||||
def _printPermissionRow(baserow, permission):
|
def _printPermissionRow(baserow, permission):
|
||||||
@ -62797,6 +62808,7 @@ def printShowSharedDriveACLs(users, useDomainAdminAccess=False):
|
|||||||
fieldsList = []
|
fieldsList = []
|
||||||
cd = emailAddress = orgUnitId = query = matchPattern = permtype = None
|
cd = emailAddress = orgUnitId = query = matchPattern = permtype = None
|
||||||
PM = PermissionMatch()
|
PM = PermissionMatch()
|
||||||
|
maxItems = 0
|
||||||
while Cmd.ArgumentsRemaining():
|
while Cmd.ArgumentsRemaining():
|
||||||
myarg = getArgument()
|
myarg = getArgument()
|
||||||
if csvPF and myarg == 'todrive':
|
if csvPF and myarg == 'todrive':
|
||||||
@ -62823,6 +62835,8 @@ def printShowSharedDriveACLs(users, useDomainAdminAccess=False):
|
|||||||
checkGroups = True
|
checkGroups = True
|
||||||
elif myarg == 'oneitemperrow':
|
elif myarg == 'oneitemperrow':
|
||||||
oneItemPerRow = True
|
oneItemPerRow = True
|
||||||
|
elif myarg == 'maxitems':
|
||||||
|
maxItems = getInteger(minVal=0)
|
||||||
elif getDriveFilePermissionsFields(myarg, fieldsList):
|
elif getDriveFilePermissionsFields(myarg, fieldsList):
|
||||||
pass
|
pass
|
||||||
elif myarg in ADMIN_ACCESS_OPTIONS:
|
elif myarg in ADMIN_ACCESS_OPTIONS:
|
||||||
@ -62920,10 +62934,11 @@ def printShowSharedDriveACLs(users, useDomainAdminAccess=False):
|
|||||||
useDomainAdminAccess=useDomainAdminAccess,
|
useDomainAdminAccess=useDomainAdminAccess,
|
||||||
fileId=shareddrive['id'], fields=fields, supportsAllDrives=True)
|
fileId=shareddrive['id'], fields=fields, supportsAllDrives=True)
|
||||||
if not permissions:
|
if not permissions:
|
||||||
if showNoPermissionsDrives == 0:
|
if showNoPermissionsDrives == 0: # no permissions and showNoPermissionDrives False - ignore
|
||||||
continue
|
continue
|
||||||
matchFeed.append(shareddrive)
|
matchFeed.append(shareddrive) # no permissions and showNoPermissionDrives Only/True - keep
|
||||||
elif showNoPermissionsDrives < 0:
|
continue
|
||||||
|
if showNoPermissionsDrives < 0: # permissions and showNoPermissionDrives Only/True - ignore
|
||||||
continue
|
continue
|
||||||
if pmselect:
|
if pmselect:
|
||||||
if not PM.CheckPermissionMatches(permissions):
|
if not PM.CheckPermissionMatches(permissions):
|
||||||
@ -62941,6 +62956,9 @@ def printShowSharedDriveACLs(users, useDomainAdminAccess=False):
|
|||||||
elif checkGroups and permission['emailAddress'] in groupsSet:
|
elif checkGroups and permission['emailAddress'] in groupsSet:
|
||||||
shareddrive['permissions'].append(permission)
|
shareddrive['permissions'].append(permission)
|
||||||
if shareddrive['permissions']:
|
if shareddrive['permissions']:
|
||||||
|
numItems = len(shareddrive['permissions'])
|
||||||
|
if numItems > maxItems > 0:
|
||||||
|
shareddrive['permissions'] = shareddrive['permissions'][0:maxItems]
|
||||||
matchFeed.append(shareddrive)
|
matchFeed.append(shareddrive)
|
||||||
except (GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError,
|
except (GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError,
|
||||||
GAPI.insufficientAdministratorPrivileges, GAPI.insufficientFilePermissions,
|
GAPI.insufficientAdministratorPrivileges, GAPI.insufficientFilePermissions,
|
||||||
|
@ -67,6 +67,7 @@ DOMAIN_CANNOT_USE_APIS = 'domainCannotUseApis'
|
|||||||
DOMAIN_NOT_FOUND = 'domainNotFound'
|
DOMAIN_NOT_FOUND = 'domainNotFound'
|
||||||
DOMAIN_NOT_VERIFIED_SECONDARY = 'domainNotVerifiedSecondary'
|
DOMAIN_NOT_VERIFIED_SECONDARY = 'domainNotVerifiedSecondary'
|
||||||
DOMAIN_POLICY = 'domainPolicy'
|
DOMAIN_POLICY = 'domainPolicy'
|
||||||
|
DOWNLOAD_QUOTA_EXCEEDED = 'downloadQuotaExceeded'
|
||||||
DUPLICATE = 'duplicate'
|
DUPLICATE = 'duplicate'
|
||||||
EVENT_DURATION_EXCEEDS_LIMIT = 'eventDurationExceedsLimit'
|
EVENT_DURATION_EXCEEDS_LIMIT = 'eventDurationExceedsLimit'
|
||||||
FAILED_PRECONDITION = 'failedPrecondition'
|
FAILED_PRECONDITION = 'failedPrecondition'
|
||||||
@ -206,7 +207,7 @@ DRIVE_ACCESS_THROW_REASONS = DRIVE_USER_THROW_REASONS+[FILE_NOT_FOUND, FORBIDDEN
|
|||||||
DRIVE_COPY_THROW_REASONS = DRIVE_ACCESS_THROW_REASONS+[CANNOT_COPY_FILE, BAD_REQUEST, RESPONSE_PREPARATION_FAILURE, TEAMDRIVES_SHARING_RESTRICTION_NOT_ALLOWED,
|
DRIVE_COPY_THROW_REASONS = DRIVE_ACCESS_THROW_REASONS+[CANNOT_COPY_FILE, BAD_REQUEST, RESPONSE_PREPARATION_FAILURE, TEAMDRIVES_SHARING_RESTRICTION_NOT_ALLOWED,
|
||||||
FIELD_NOT_WRITABLE, RATE_LIMIT_EXCEEDED, USER_RATE_LIMIT_EXCEEDED,
|
FIELD_NOT_WRITABLE, RATE_LIMIT_EXCEEDED, USER_RATE_LIMIT_EXCEEDED,
|
||||||
STORAGE_QUOTA_EXCEEDED, TEAMDRIVE_FILE_LIMIT_EXCEEDED, TEAMDRIVE_HIERARCHY_TOO_DEEP]
|
STORAGE_QUOTA_EXCEEDED, TEAMDRIVE_FILE_LIMIT_EXCEEDED, TEAMDRIVE_HIERARCHY_TOO_DEEP]
|
||||||
DRIVE_GET_THROW_REASONS = DRIVE_USER_THROW_REASONS+[FILE_NOT_FOUND]
|
DRIVE_GET_THROW_REASONS = DRIVE_USER_THROW_REASONS+[FILE_NOT_FOUND, DOWNLOAD_QUOTA_EXCEEDED]
|
||||||
DRIVE3_CREATE_ACL_THROW_REASONS = [BAD_REQUEST, INVALID, INVALID_SHARING_REQUEST, OWNERSHIP_CHANGE_ACROSS_DOMAIN_NOT_PERMITTED, CANNOT_SET_EXPIRATION,
|
DRIVE3_CREATE_ACL_THROW_REASONS = [BAD_REQUEST, INVALID, INVALID_SHARING_REQUEST, OWNERSHIP_CHANGE_ACROSS_DOMAIN_NOT_PERMITTED, CANNOT_SET_EXPIRATION,
|
||||||
NOT_FOUND, TEAMDRIVE_DOMAIN_USERS_ONLY_RESTRICTION, TEAMDRIVE_TEAM_MEMBERS_ONLY_RESTRICTION,
|
NOT_FOUND, TEAMDRIVE_DOMAIN_USERS_ONLY_RESTRICTION, TEAMDRIVE_TEAM_MEMBERS_ONLY_RESTRICTION,
|
||||||
TARGET_USER_ROLE_LIMITED_BY_LICENSE_RESTRICTION, INSUFFICIENT_ADMINISTRATOR_PRIVILEGES, SHARING_RATE_LIMIT_EXCEEDED,
|
TARGET_USER_ROLE_LIMITED_BY_LICENSE_RESTRICTION, INSUFFICIENT_ADMINISTRATOR_PRIVILEGES, SHARING_RATE_LIMIT_EXCEEDED,
|
||||||
@ -435,6 +436,8 @@ class domainNotVerifiedSecondary(Exception):
|
|||||||
pass
|
pass
|
||||||
class domainPolicy(Exception):
|
class domainPolicy(Exception):
|
||||||
pass
|
pass
|
||||||
|
class downloadQuotaExceeded(Exception):
|
||||||
|
pass
|
||||||
class duplicate(Exception):
|
class duplicate(Exception):
|
||||||
pass
|
pass
|
||||||
class eventDurationExceedsLimit(Exception):
|
class eventDurationExceedsLimit(Exception):
|
||||||
@ -696,6 +699,7 @@ REASON_EXCEPTION_MAP = {
|
|||||||
DOMAIN_NOT_FOUND: domainNotFound,
|
DOMAIN_NOT_FOUND: domainNotFound,
|
||||||
DOMAIN_NOT_VERIFIED_SECONDARY: domainNotVerifiedSecondary,
|
DOMAIN_NOT_VERIFIED_SECONDARY: domainNotVerifiedSecondary,
|
||||||
DOMAIN_POLICY: domainPolicy,
|
DOMAIN_POLICY: domainPolicy,
|
||||||
|
DOWNLOAD_QUOTA_EXCEEDED: downloadQuotaExceeded,
|
||||||
DUPLICATE: duplicate,
|
DUPLICATE: duplicate,
|
||||||
EVENT_DURATION_EXCEEDS_LIMIT: eventDurationExceedsLimit,
|
EVENT_DURATION_EXCEEDS_LIMIT: eventDurationExceedsLimit,
|
||||||
FAILED_PRECONDITION: failedPrecondition,
|
FAILED_PRECONDITION: failedPrecondition,
|
||||||
|
Reference in New Issue
Block a user