From a0e4be4b50857688e12e5357ec82370ae4309bbc Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Wed, 21 Feb 2024 14:20:40 -0800 Subject: [PATCH] Use `gam.cfg/use_course_owner_access` in course copyfrom. --- docs/GamUpdates.md | 12 +++++++++--- src/GamUpdate.txt | 6 ++++++ src/gam/__init__.py | 10 ++++++---- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/docs/GamUpdates.md b/docs/GamUpdates.md index 6925968e..a57668c8 100644 --- a/docs/GamUpdates.md +++ b/docs/GamUpdates.md @@ -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.70.02 + +In 6.69.00, GAM starting using course owner access when using `copyfrom` in `gam create|update course` +regardless of the value of `gam.cfg/use_course_owner_access`. This prevents copying from courses +with a deleted user. GAM now uses the value of `gam.cfg/use_course_owner_access` when `copyfrom` is used.o + ### 6.70.01 Added `gmail_cse_incert_dir` and `gmail_cse_inkey_dir` path variables to `gam.cfg` that provide @@ -25,10 +31,10 @@ This is an initial, minimally tested release; proceed with care and report all i ### 6.69.00 -Added `use_classroom_owner_access` Boolean variable to `gam.cfg` that controls how GAM gets -classroom member information and removes students/teachers. Client access does not provide +Added `use_course_owner_access` Boolean variable to `gam.cfg` that controls how GAM gets +classroom member information and removes students/teachers. Client/admin access does not provide complete information about non-domain students/teachers. -* `False` - Use client access; this is the default. Use if you don't have non-domain members in your courses. +* `False` - Use client/admin access; this is the default. Use if you don't have non-domain members in your courses. * `True` - Use service account access as the classroom owner. An extra API call is required per course to authenticate the owner; this will affect performance Added the following command which must be used to delete classroom invitations for non-domain students/teachers. diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index 29e06b73..099452df 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -2,6 +2,12 @@ Merged GAM-Team version +6.70.02 + +In 6.69.00, GAM starting using course owner access when using `copyfrom` in `gam create|update course` +regardless of the value of `gam.cfg/use_course_owner_access`. This prevents copying from courses +with a deleted user. GAM now uses the value of `gam.cfg/use_course_owner_access` when `copyfrom` is used. + 6.70.01 Added `gmail_cse_incert_dir` and `gmail_cse_inkey_dir` path variables to `gam.cfg` that provide diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 5df0d716..17b7e150 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -44381,10 +44381,12 @@ class CourseAttributes(): else: return True # ocroom - copyfrom course owner - if self.announcementStates or self.materialStates or self.workStates or self.copyTopics or self.members != 'none': - _, self.ocroom = buildGAPIServiceObject(API.CLASSROOM, f'uid:{self.ownerId}') - if self.ocroom is None: - return False + self.ocroom = self.croom + if GC.Values[GC.USE_COURSE_OWNER_ACCESS]: + if self.announcementStates or self.materialStates or self.workStates or self.copyTopics or self.members != 'none': + _, self.ocroom = buildGAPIServiceObject(API.CLASSROOM, f'uid:{self.ownerId}') + if self.ocroom is None: + return False if self.members != 'none': _, self.teachers, self.students = _getCourseAliasesMembers(self.croom, self.ocroom, self.courseId, {'members': self.members}, 'nextPageToken,teachers(profile(emailAddress,id))',