reapply_domain_permissions
Recreate domain-wide permissions on Shared Drive files using a Google Sheet audit. Restores ACLs with domain roles and file discovery settings.
Instructions
Step 13 — Reapply domain-wide permissions from the audit sheet.
DESTRUCTIVE — requires confirmed=True to execute.
Reads the all_permissions sheet and re-creates every domain ACL on
the corresponding file in the Shared Drive. Includes the
allowFileDiscovery setting so domain-wide visibility is preserved.
Args:
user_email: The admin email executing the command.
sheet_id: The ID of the Google Sheet containing the audit.
sheet_name: The tab containing ACL data (default: "all_permissions").
confirmed: Must be True to execute. False returns a preview.
GAM command:
gam config csv_input_row_filter "permission.type:regex:domain"
redirect stdout ./reapply_domain_perms.txt multiprocess
redirect stderr stdout
csv gsheet <user_email> <sheet_id> <sheet_name>
gam user <user_email> create drivefileacl "~id"
"~permission.type" "~permission.domain"
role "~permission.role"
allowfilediscovery "~permission.allowFileDiscovery"
nodetails
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sheet_id | Yes | ||
| confirmed | No | ||
| sheet_name | No | all_permissions | |
| user_email | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |