[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-19。"],[],[],null,["# Use strict act-as mode\n\n| **Preview\n| --- Dataform strict act-as mode**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n| **Note:** For support during the preview, email [dataform-preview-support@google.com](mailto:dataform-preview-support@google.com).\n\nThe strict act-as mode enables an additional security check for the following\nuser actions in Dataform:\n\n- Creating or updating a repository\n- Creating or updating a workflow configuration\n- Creating a workflow invocation\n- Updating a release configuration\n\nThis additional security check requires that the user performing these actions\nhas the `iam.serviceAccounts.actAs` permission on the effective service\naccount, which is the service account whose credentials are used to\nexecute workflows. For more information on service accounts, see\n[Attach service accounts to resources](/iam/docs/attach-service-accounts).\n\nYou can enable this mode in the following ways:\n\n- When [creating a repository](/dataform/docs/create-repository#create-repository)\n- When updating an existing repository with the `strict_act_as_checks` repository flag\n\nRequired roles\n--------------\n\n\nTo get the permissions that\nyou need to complete the tasks in this document,\n\nask your administrator to grant you the\n\n\n[Service Account User](/iam/docs/roles-permissions/iam#iam.serviceAccountUser) (`roles/iam.serviceAccountUser`)\nIAM role on the custom service account.\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nYou might also be able to get\nthe required permissions through [custom\nroles](/iam/docs/creating-custom-roles) or other [predefined\nroles](/iam/docs/roles-overview#predefined).\n\nDetermine the effective service account\n---------------------------------------\n\nYou can determine the effective service account that is executing the workflows\naccording to the resource type and the following conditions:\n\n| **Note:** When strict act-as mode is enabled, you can't execute workflows with the default [Dataform service account](/dataform/docs/access-control#about-service-accounts).\n\nGrant the Service Account User IAM role\n---------------------------------------\n\nThe [Service Account User](/iam/docs/service-account-permissions#user-role)\nrole (`roles/iam.serviceAccountUser`) contains the `iam.serviceAccounts.actAs`\npermission, which is required for strict act-as mode. When you use the\nDataform API, you must have the Service Account User role granted\nfor the effective service account based on the\n[`projects.locations.repositories` method](/dataform/reference/rest/v1/projects.locations.repositories)\nthat you're calling:\n\n- [`create`](/dataform/reference/rest/v1/projects.locations.repositories/create) or [`patch`](/dataform/reference/rest/v1/projects.locations.repositories/patch)\n - If the `Repository.ServiceAccount` property is set, then you should have the Service Account User role granted for that property.\n - If you're calling the `patch` method, then you should have the Service Account User role granted for all the effective service accounts in all the workflow configurations in the repository.\n- [`workflowConfigs.create`](/dataform/reference/rest/v1/projects.locations.repositories.workflowConfigs/create) or [`workflowConfigs.patch`](/dataform/reference/rest/v1/projects.locations.repositories.workflowConfigs/patch)\n - You should have the Service Account User role granted for the effective service account used in the workflow configuration.\n- [`releaseConfigs.patch`](/dataform/reference/rest/v1/projects.locations.repositories.releaseConfigs/patch)\n - You should have the Service Account User role granted for all the effective service accounts used in the workflow configurations using this release configuration.\n- [`workflowInvocations.create`](/dataform/reference/rest/v1/projects.locations.repositories.workflowInvocations/create)\n - You should have the Service Account User role granted for the effective service account used in the workflow invocation.\n\nFor more information, see the\n[required roles for creating a workflow configuration](/dataform/docs/schedule-runs#required_roles)\nand the\n[required roles for creating a release configuration](/dataform/docs/configure-compilation#required_roles).\n\nAutomatic releases for repositories\n-----------------------------------\n\n| **Warning:** Because there is no guarantee that the user writing the code has the `iam.serviceAccounts.actAs` permission on the effective service accounts for a [third-party repository](/dataform/docs/connect-repository), it's your responsibility to control the code changes in third-party repositories with the code review process.\n\nWhen act-as mode is enabled, automatic releases are disabled for\nDataform repository\n[release configurations](/dataform/docs/configure-compilation#create-release-configuration).\nThis doesn't apply to repositories connected to third-party repositories.\n\nIn addition, if you enable act-as mode, there are checks on the repository for\nwhether it has an automatic release configuration set using the\n[Cron schedule](/dataform/docs/configure-compilation#release-configuration-details).\nThis doesn't apply to repositories connected to third-party repositories.\n\nWhat's next\n-----------\n\n- To learn more how to create a repository, see [Create a repository](/dataform/docs/create-repository).\n- To learn how to create a workflow configuration, see [Schedule runs](/dataform/docs/schedule-runs).\n- To learn how to create a release configuration, see [Configure compilations](/dataform/docs/configure-compilation)."]]