Updated gam <UserTypeEntity> print filelist ... showshareddrivepermissions

This commit is contained in:
Ross Scroggs
2024-05-31 20:47:00 -07:00
parent 1f9624ad5c
commit f6b949e4c1
9 changed files with 41 additions and 12 deletions

View File

@@ -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
### 6.76.11
Updated `gam <UserTypeEntity> print filelist ... showshareddrivepermissions` to display
progress messages to stderr as a separate API call must be made for every file/folder on the Shared Drive
to get its permissions. As this can take a long time, the progress messages indicate that progress is being made.
### 6.76.10
Added `fromgmail` to `<EventType>` that can be used in `gam calendars <CalendarEntity> print|show events ... eventtype fromgmail`.

View File

@@ -335,7 +335,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$ ./gam version
WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
GAMADV-XTD3 6.76.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.76.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.3 64-bit final
MacOS Sonoma 14.4.1 x86_64
@@ -1009,7 +1009,7 @@ writes the credentials into the file oauth2.txt.
C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt
C:\GAMADV-XTD3>gam version
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
GAMADV-XTD3 6.76.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.76.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.3 64-bit final
Windows-10-10.0.17134 AMD64

View File

@@ -39,6 +39,8 @@
| License Name | License SKU | Abbreviation |
|--------------|-------------|---------------|
| AI Meetings and Messaging | 1010470007 | aimeetingsandmessaging |
| AI Security | 1010470006 | aisecurity |
| AppSheet Core | 1010380001 | appsheetcore |
| AppSheet Enterprise Standard | 1010380002 | appsheetstandard |
| AppSheet Enterprise Plus | 1010380003 | appsheetplus |
@@ -136,6 +138,8 @@
4tb | drive4tb | googledrivestorage4tb | Google-Drive-storage-4TB |
8tb | drive8tb | googledrivestorage8tb | Google-Drive-storage-8TB |
16tb | drive16tb | googledrivestorage16tb | Google-Drive-storage-16TB |
aimeetingsandmessaging | 1010470007 | AI Meetings and Messaging |
aisecurity | 1010470006 | AI Security |
appsheetcore | 1010380001 | AppSheet Core |
appsheetstandard | appsheetenterprisestandard | 1010380002 | AppSheet Enterprise Standard |
appsheetplus | appsheetenterpriseplus | 1010380003 | AppSheet Enterprise Plus |

View File

@@ -49,7 +49,8 @@
rules|
saml|
token|tokens|oauthtoken|
useraccounts
useraccounts|
vault
gam report <ActivityApplicationName> [todrive <ToDriveAttributes>*]
[(user all|<UserItem>)|(orgunit|org|ou <OrgUnitPath> [showorgunit])|(select <UserTypeEntity>)]

View File

@@ -59,11 +59,13 @@ Thanks to Duncan Isaksen-Loxton for a script to help manage multiple domains.
4tb | drive4tb | googledrivestorage4tb | Google-Drive-storage-4TB |
8tb | drive8tb | googledrivestorage8tb | Google-Drive-storage-8TB |
16tb | drive16tb | googledrivestorage16tb | Google-Drive-storage-16TB |
aimeetingsandmessaging | 1010470007 | AI Meetings and Messaging |
aisecurity | 1010470006 | AI Security |
appsheetcore | 1010380001 | AppSheet Core |
appsheetstandard | appsheetenterprisestandard | 1010380002 | AppSheet Enterprise Standard |
appsheetplus | appsheetenterpriseplus | 1010380003 | AppSheet Enterprise Plus |
assuredcontrols | 1010390001 | Assured Controls |
bce | beyondcorp | beyondcorpenterprise | 1010400001 | Beyond Corp Enterprise |
bce | beyondcorp | beyondcorpenterprise | cep | chromeenterprisepremium | 1010400001 | Chrome Enterprise Premium |
cdm | chrome | googlechromedevicemanagement | Google-Chrome-Device-Management |
cloudidentity | identity | 1010010001 | Cloud Identity |
cloudidentitypremium | identitypremium | 1010050001 | Cloud Identity Premium |

View File

@@ -3,7 +3,7 @@
Print the current version of Gam with details
```
gam version
GAMADV-XTD3 6.76.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.76.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.3 64-bit final
MacOS Sonoma 14.4.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
```
gam version timeoffset
GAMADV-XTD3 6.76.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.76.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.3 64-bit final
MacOS Sonoma 14.4.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
```
gam version extended
GAMADV-XTD3 6.76.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.76.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.3 64-bit final
MacOS Sonoma 14.4.1 x86_64
@@ -64,7 +64,7 @@ MacOS High Sierra 10.13.6 x86_64
Path: /Users/Admin/bin/gamadv-xtd3
Version Check:
Current: 5.35.08
Latest: 6.76.10
Latest: 6.76.11
echo $?
1
```
@@ -72,7 +72,7 @@ echo $?
Print the current version number without details
```
gam version simple
6.76.10
6.76.11
```
In Linux/MacOS you can do:
```
@@ -82,7 +82,7 @@ echo $VER
Print the current version of Gam and address of this Wiki
```
gam help
GAM 6.76.10 - https://github.com/taers232c/GAMADV-XTD3
GAM 6.76.11 - https://github.com/taers232c/GAMADV-XTD3
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.3 64-bit final
MacOS Sonoma 14.4.1 x86_64

View File

@@ -259,6 +259,8 @@ If an item contains spaces, it should be surrounded by ".
4tb | drive4tb | googledrivestorage4tb | Google-Drive-storage-4TB |
8tb | drive8tb | googledrivestorage8tb | Google-Drive-storage-8TB |
16tb | drive16tb | googledrivestorage16tb | Google-Drive-storage-16TB |
aimeetingsandmessaging | 1010470007 | AI Meetings and Messaging |
aisecurity | 1010470006 | AI Security |
appsheetcore | 1010380001 | AppSheet Core |
appsheetstandard | appsheetenterprisestandard | 1010380002 | AppSheet Enterprise Standard |
appsheetplus | appsheetenterpriseplus | 1010380003 | AppSheet Enterprise Plus |
@@ -1580,6 +1582,7 @@ gam calendar <CalendarEntity> printacl [todrive <ToDriveAttribute>*]
<EventType> ::=
default|
focustime|
fromgmail|
outofoffice|
workinglocation
<EventTypeList> ::= "<EventType>(,<EventType>)*"
@@ -5349,7 +5352,7 @@ gam update user <UserItem> [ignorenullpassword] <UserAttribute>*
[columndelimiter <Character>] [noescapechar <Boolean>] [quotechar <Character>]
[fields <FieldNameList>] [keyfield <FieldName>] [datafield <FieldName>]]
[immutableous <OrgUnitEntity>]|
[clearschema <SchemaName> | <SchemaNameField>]
[clearschema <SchemaName>|<SchemaNameField>]
[createifnotfound] [notfoundpassword (random [<Integer>])|blocklogin|<Password>]
(groups [<GroupRole>] [[delivery] <DeliverySetting>] <GroupEntity>)*
[alias|aliases <EmailAddressList>]
@@ -5417,7 +5420,7 @@ gam <UserTypeEntity> update users [ignorenullpassword] <UserAttribute>*
[verifynotinvitable] [noactionifalias]
[updateprimaryemail <RegularExpression> <EmailReplacement>]
[updateoufromgroup <CSVFileInput> [keyfield <FieldName>] [datafield <FieldName>]]
[clearschema <SchemaName> | <SchemaNameField>]
[clearschema <SchemaName>|<SchemaNameField>]
[createifnotfound] [notfoundpassword (random [<Integer>])|blocklogin|<Password>]
(groups [<GroupRole>] [[delivery] <DeliverySetting>] <GroupEntity>)*
[alias|aliases <EmailAddressList>]

View File

@@ -2,6 +2,12 @@
Merged GAM-Team version
6.76.11
Updated `gam <UserTypeEntity> print filelist ... showshareddrivepermissions` to display
progress messages to stderr as a separate API call must be made for every file/folder on the Shared Drive
to get its permissions. As this can take a long time, the progress messages indicate that progress is being made.
6.76.10
Added `fromgmail` to `<EventType>` that can be used in `gam calendars <CalendarEntity> print|show events ... eventtype fromgmail`.

View File

@@ -53776,6 +53776,7 @@ def printFileList(users):
csvPF.WriteRowTitlesJSONNoFilter(row)
def _printFileInfo(drive, user, f_file, cleanFileName):
nonlocal getSharedDriveACLsCount, getSharedDriveACLsCountMsg
driveId = f_file.get('driveId')
checkSharedDrivePermissions = getPermissionsForSharedDrives and driveId and 'permissions' not in f_file
if (f_file.get('noDisplay', False) or
@@ -53789,6 +53790,10 @@ def printFileList(users):
(DLP.onlySharedDrives and not driveId)):
return
if checkSharedDrivePermissions:
if not incrementalPrint:
getSharedDriveACLsCount += 1
if getSharedDriveACLsCount % 100 == 0:
writeStderr(f'{Msg.GOT} {getSharedDriveACLsCount} {getSharedDriveACLsCountMsg}')
try:
f_file['permissions'] = callGAPIpages(drive.permissions(), 'list', 'permissions',
throwReasons=GAPI.DRIVE3_GET_ACL_REASONS,
@@ -54053,6 +54058,7 @@ def printFileList(users):
elif myarg == 'showshareddrivepermissions':
getPermissionsForSharedDrives = True
permissionsFields = f'nextPageToken,permissions({",".join(DRIVEFILE_BASIC_PERMISSION_FIELDS)})'
getSharedDriveACLsCountMsg = f'{Ent.Plural(Ent.DRIVE_FILE_OR_FOLDER_ACL)} {Msg.FOR} {Ent.Plural(Ent.SHAREDDRIVE)}\n'
elif myarg == 'pmfilter':
pmselect = False
elif myarg == 'oneitemperrow':
@@ -54198,6 +54204,7 @@ def printFileList(users):
filePathInfo = initFilePathInfo(pathDelimiter)
filesPrinted = set()
mimeTypeInfo = {}
getSharedDriveACLsCount = 0
if buildTree:
printGettingAllEntityItemsForWhom(Ent.DRIVE_FILE_OR_FOLDER, user, i, count, query=DLP.fileIdEntity['query'])
if not incrementalPrint: