Failure to restore permissions if another domain has disallowed sharing
Description
Discovered in https://gitlab.developers.cam.ac.uk/uis/devops/gsuite/sync-deploy/-/jobs/2218040. Error 400 with reason "shareInNotPermitted"
We should catch these, remove the offending permissions from those trying to be restored (but log them) and then continue.
Further details
The code already does this for missing accounts (aka error reason "invalidSharingRequest").
Should be "easy" to extend this to create a list of domains to ignore if they give the "shareInNotPermitted" failure and then skip those when restoring permissions.
Task list
-
Catch 400s with "shareInNotPermitted" -
Scrap domain from error and add to a list of domains to ignore -
Ignore permissions with email addresses with a domain in the domains to ignore -
Ensure such actions are logged
Acceptance criteria
-
Permissions restoration skips those reporting this failure and the remaining permission restoration can complete.