Added error message to gam report commands to indicate forbidden access
Some checks failed
Build and test GAM / build (Win64, build, 10, VC-WIN64A, windows-2022) (push) Has been cancelled
Build and test GAM / build (aarch64, build, 3, linux-aarch64, ubuntu-24.04-arm) (push) Has been cancelled
Build and test GAM / build (aarch64, build, 4, linux-aarch64, ubuntu-22.04-arm) (push) Has been cancelled
Build and test GAM / build (aarch64, build, 6, linux-aarch64, ubuntu-22.04-arm, yes) (push) Has been cancelled
Build and test GAM / build (aarch64, build, 8, darwin64-arm64, macos-14) (push) Has been cancelled
Build and test GAM / build (aarch64, build, 9, darwin64-arm64, macos-15) (push) Has been cancelled
Build and test GAM / build (x86_64, build, 1, linux-x86_64, ubuntu-22.04) (push) Has been cancelled
Build and test GAM / build (x86_64, build, 2, linux-x86_64, ubuntu-24.04) (push) Has been cancelled
Build and test GAM / build (x86_64, build, 5, linux-x86_64, ubuntu-22.04, yes) (push) Has been cancelled
Build and test GAM / build (x86_64, build, 7, darwin64-x86_64, macos-13) (push) Has been cancelled
Build and test GAM / build (x86_64, test, 11, ubuntu-24.04, 3.10) (push) Has been cancelled
Build and test GAM / build (x86_64, test, 12, ubuntu-24.04, 3.11) (push) Has been cancelled
Build and test GAM / build (x86_64, test, 13, ubuntu-24.04, 3.12) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Check for Google Root CA Updates / check-apis (push) Has been cancelled
Build and test GAM / merge (push) Has been cancelled
Build and test GAM / publish (push) Has been cancelled

This commit is contained in:
Ross Scroggs 2025-03-05 10:49:23 -08:00
parent b3867fba5b
commit d791a864fa
No known key found for this signature in database
GPG Key ID: 54585EA0887857D5
2 changed files with 15 additions and 7 deletions

View File

@ -1,3 +1,11 @@
7.05.08
Added error message to `gam report` commands to indicate forbidden access;
previously, no error message was displayed.
```
ERROR: Customer ID: C012abc34, Caller does not have access to the customers reporting data.
```
7.05.07
Fixed bug in `gam calendars <CalendarEntity> info events` and `gam <UserTypeEntity> info events`

View File

@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
"""
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
__version__ = '7.05.07'
__version__ = '7.05.08'
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
#pylint: disable=wrong-import-position
@ -13429,8 +13429,8 @@ def doReportUsage():
break
except GAPI.invalidInput as e:
systemErrorExit(GOOGLE_API_ERROR_RC, str(e))
except GAPI.forbidden:
accessErrorExit(None)
except GAPI.forbidden as e:
accessErrorExit(None, str(e))
if startUseDate:
reportName = f'{report.capitalize()} Usage Report - {startUseDate}:{endUseDate}'
else:
@ -14027,8 +14027,8 @@ def doReport():
printErrorMessage(BAD_REQUEST_RC, Msg.BAD_REQUEST)
exitUserLoop = True
break
except GAPI.forbidden:
accessErrorExit(None)
except GAPI.forbidden as e:
accessErrorExit(None, str(e))
startDateTime += oneDay
if exitUserLoop:
break
@ -14108,8 +14108,8 @@ def doReport():
continue
except GAPI.invalidInput as e:
systemErrorExit(GOOGLE_API_ERROR_RC, str(e))
except GAPI.forbidden:
accessErrorExit(None)
except GAPI.forbidden as e:
accessErrorExit(None, str(e))
startDateTime += oneDay
csvPF.writeCSVfile(f'Customer Report - {tryDate}')
else: # activityReports