将文档共享权限改为域内链接可查看时,Google API Reports无活动返回
change_document_access_scope Event for Drive Permission Update Let's break down why this specific permission change isn't triggering the expected event in the Admin SDK Reports API:
1. Event Classification Nuances in Google's API
Google's event tracking for Drive permissions doesn't treat all scope changes equally. When you update permissions to "Anyone at domain with the link can edit/comment", you're modifying the interactive access level (from view-only to edit/comment), which clearly qualifies as an "access scope" change and triggers change_document_access_scope.
However, when switching from "Anyone at domain can find and access" to "Anyone at domain with the link can view", the core access right (domain users can view the document) remains the same—you're only adjusting the discovery visibility (from publicly discoverable in the domain to link-only). Google likely categorizes this as a visibility change rather than an access scope change, so it doesn't fire the change_document_access_scope event.
2. Verify the Actual Event Triggered
To confirm this, try calling the activities.list API without the eventName filter (keep userKey=all, applicationName=drive, and your startTime/endTime parameters). Look through the returned events for the timestamp of your permission change—you'll likely find it under a different event name, such as:
change_document_visibilitychange_document_sharing_permissions
Once you identify the correct event name, you can update your application to listen for that event instead (or in addition) to capture this specific permission adjustment.
3. Alignment with API Documentation Intent
While the official docs frame change_document_access_scope as covering access range changes, the actual implementation prioritizes changes that modify who can access the document (e.g., domain vs. external users) or what they can do with it (view/edit/comment). Your scenario is a tweak to how domain users discover the document, not a change to their core access rights, so it falls outside the event's intended trigger conditions.
内容的提问来源于stack exchange,提问作者MichalL

