Skip to content

Team Drive Folder Feature

Overview

Admins/owners can assign a Google Drive folder to a team. When assigned, all current team members automatically get writer access to that folder. Access is kept in sync as members are added or removed.

Prerequisites

  • The org must have Google Calendar integration connected with Drive scopes enabled (Settings > Calendar Integration)
  • The user performing folder operations must be an admin or owner of the org

Behavior

Assigning a Folder

  1. Admin clicks "Assign Drive Folder" on a team card
  2. A folder picker dialog opens, browsing the org's Google Drive
  3. Admin selects a folder and clicks "Select"
  4. Backend shares the folder with all current team members (writer access)
  5. The folder appears as a clickable chip on the team card, linking to Google Drive
  6. Members who have no email in their profile are silently skipped

If the team already has a folder assigned, the old folder's permissions are revoked before the new folder is shared.

Removing a Folder

  1. Admin clicks the X icon on the folder chip
  2. Confirms the action in a dialog
  3. Backend revokes all team members' access to that Drive folder
  4. The folder chip disappears from the team card

Adding a Member to a Team

When a member is added to a team that has a Drive folder assigned:

  • The new member is automatically granted writer access to the team's Drive folder
  • This happens via a non-blocking API call (the member add succeeds even if the Drive share fails)
  • The permission is recorded in the team's permissionMap for later revocation

Removing a Member from a Team

When a member is removed from a team that has a Drive folder assigned:

  • The member's access to the Drive folder is automatically revoked
  • This happens via a non-blocking API call (the member remove succeeds even if the Drive revoke fails)
  • The permission entry is removed from the team's permissionMap

Deleting a Team

Deleting a team does NOT automatically revoke Drive folder access. Admins should remove the folder assignment before deleting the team if they want to revoke access.

Data Model

Firestore: orgs/{orgId}/teams/{teamId}

The driveFolder field is stored on the team document:

driveFolder: {
  id: string             // Google Drive folder ID
  name: string           // Folder display name
  url: string            // Google Drive web URL
  assignedBy: string     // userId of admin who assigned it
  assignedAt: Date
  permissionMap: {       // tracks Drive permission IDs for revocation
    [userId]: permissionId
  }
}

API Endpoints

All endpoints require authentication and admin/owner role.

MethodPathDescription
GET/api/v1/drive/folders?orgId=X&parentId=YList child folders in Drive
POST/api/v1/drive/teams/:teamId/folderAssign a folder to a team
DELETE/api/v1/drive/teams/:teamId/folder?orgId=XRemove folder from team
POST/api/v1/drive/teams/:teamId/sync-memberSync a member's folder access

Limitations

  • Only one folder per team (assigning a new one replaces the old)
  • If the Google integration token expires or is revoked, folder operations will fail
  • Members without an email in usersPub are silently skipped during sharing
  • Team deletion does not auto-revoke Drive access

Internal docs — access restricted via Cloudflare Zero Trust.