diff --git a/docs/GamUpdates.md b/docs/GamUpdates.md index 8b7cb56c..6ad6a0ae 100644 --- a/docs/GamUpdates.md +++ b/docs/GamUpdates.md @@ -38,6 +38,14 @@ gam print|show chatmembers|asadmin * See: https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Chat +Added `use_chat_admin_access` Boolean variable to `gam.cfg`. +``` +* When False, GAM uses user access when making all Chat API calls. For calls that support admin access, + this can be overridden with the asadmin command line option. +* When True, GAM uses admin access for Chat API calls that support admin access; other calls will use user access. +* Default: False +``` + ### 6.76.15 Fixed bug in `gam print|show filesharecounts summary only summaryuser ` diff --git a/docs/gam.cfg.md b/docs/gam.cfg.md index 5d10024d..25659058 100644 --- a/docs/gam.cfg.md +++ b/docs/gam.cfg.md @@ -589,6 +589,12 @@ update_cros_ou_with_id Set to true if you are getting the following error: `400: invalidInput - Invalid Input: Inconsistent Orgunit id and path in request` Default: False +use_chat_admin_access + When False, GAM uses user access when making Chat API calls. For calls that support admin access, + this can be overridden with the asadmin command line option. + When True, GAM uses admin access for Chat API calls that support admin access; + other calls will use user access. + Default: False use_classroom_owner_access How is classroom member information obtained and how are classroom members deleted. Client access does not provide complete information about non-domain students/teachers. diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index a5f067bb..2b5e51a3 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -30,6 +30,14 @@ gam print|show chatmembers|asadmin * See: https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Chat +Added `use_chat_admin_access` Boolean variable to `gam.cfg`. +``` +* When False, GAM uses user access when making all Chat API calls. For calls that support admin access, + this can be overridden with the asadmin command line option. +* When True, GAM uses admin access for Chat API calls that support admin access; other calls will use user access. +* Default: False +``` + 6.76.15 Fixed bug in `gam print|show filesharecounts summary only summaryuser ` diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 41828c36..d467baf6 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -25163,7 +25163,7 @@ def exitIfChatNotConfigured(chat, kvList, errMsg, i, count): entityActionFailedWarning(kvList, errMsg, i, count) def _getChatAdminAccess(adminAPI, userAPI): - if checkArgumentPresent(ADMIN_ACCESS_OPTIONS): + if checkArgumentPresent(ADMIN_ACCESS_OPTIONS) or GC.Values[GC.USE_CHAT_ADMIN_ACCESS]: return (True, adminAPI) return (False, userAPI) diff --git a/src/gam/gamlib/glcfg.py b/src/gam/gamlib/glcfg.py index 9b39a949..c2a8e251 100644 --- a/src/gam/gamlib/glcfg.py +++ b/src/gam/gamlib/glcfg.py @@ -292,6 +292,8 @@ TODRIVE_USER = 'todrive_user' TRUNCATE_CLIENT_ID = 'truncate_client_id' # Update CrOS org unit with orgUnitId UPDATE_CROS_OU_WITH_ID = 'update_cros_ou_with_id' +# Use chat asadmin where possible +USE_CHAT_ADMIN_ACCESS = 'use_chat_admin_access' # Use course owner for course access USE_COURSE_OWNER_ACCESS = 'use_course_owner_access' # Use Project ID as Project Name and App Name @@ -434,6 +436,7 @@ Defaults = { TODRIVE_USER: '', TRUNCATE_CLIENT_ID: FALSE, UPDATE_CROS_OU_WITH_ID: FALSE, + USE_CHAT_ADMIN_ACCESS: FALSE, USE_COURSE_OWNER_ACCESS: FALSE, USE_PROJECTID_AS_NAME: FALSE, USER_MAX_RESULTS: '500', @@ -595,6 +598,7 @@ VAR_INFO = { TODRIVE_USER: {VAR_TYPE: TYPE_STRING, VAR_LIMITS: (0, None)}, TRUNCATE_CLIENT_ID: {VAR_TYPE: TYPE_BOOLEAN}, UPDATE_CROS_OU_WITH_ID: {VAR_TYPE: TYPE_BOOLEAN}, + USE_CHAT_ADMIN_ACCESS: {VAR_TYPE: TYPE_BOOLEAN}, USE_COURSE_OWNER_ACCESS: {VAR_TYPE: TYPE_BOOLEAN}, USE_PROJECTID_AS_NAME: {VAR_TYPE: TYPE_BOOLEAN}, USER_MAX_RESULTS: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (1, 500)},