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
- Admin clicks "Assign Drive Folder" on a team card
- A folder picker dialog opens, browsing the org's Google Drive
- Admin selects a folder and clicks "Select"
- Backend shares the folder with all current team members (writer access)
- The folder appears as a clickable chip on the team card, linking to Google Drive
- 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
- Admin clicks the X icon on the folder chip
- Confirms the action in a dialog
- Backend revokes all team members' access to that Drive folder
- 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
permissionMapfor 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.
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/drive/folders?orgId=X&parentId=Y | List child folders in Drive |
| POST | /api/v1/drive/teams/:teamId/folder | Assign a folder to a team |
| DELETE | /api/v1/drive/teams/:teamId/folder?orgId=X | Remove folder from team |
| POST | /api/v1/drive/teams/:teamId/sync-member | Sync 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
usersPubare silently skipped during sharing - Team deletion does not auto-revoke Drive access