[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# Roles and permissions\n\nGoogle Cloud offers Identity and Access Management (IAM),\nwhich enables you to give more granular access to specific\nGoogle Cloud resources and prevents unwanted access to other\nresources. This page describes the Service Directory API roles. For a detailed\ndescription of IAM, read the [IAM documentation](/iam/docs).\n\nIAM enables you to adopt the\n[security principle of least privilege](https://wikipedia.org/wiki/Principle_of_least_privilege),\nso you grant only the necessary access to your resources.\n\nIAM enables you to control *who* has *what* permissions to\n*which* resources by setting IAM policies. IAM\npolicies grant specific roles to a user, giving the user certain\npermissions.\n\nPermissions and Roles\n---------------------\n\nEvery Service Directory API method requires the caller to have the necessary\nIAM permissions. You can assign permissions by granting roles to\na user, group, or service account. In addition to the basic Owner,\nEditor, and Viewer roles, you can grant Service Directory API roles to the users\nof your project.\n\n### Permissions\n\nYou can find out which permissions are required for each method in the\nService Directory\n[API reference documentation](/service-directory/docs/reference/rest).\n\n### Roles\n\nAccess Control using the Google Cloud console\n---------------------------------------------\n\nYou can use the Google Cloud console to manage access control for your\nregistry.\n\nTo set access controls at the project level: \n\n### Console\n\n1. In the Google Cloud console, go to the **IAM** page.\n\n [Go to IAM](https://console.cloud.google.com/iam-admin/iam)\n2. Select your project from the top pull-down menu.\n\n3. Click **Add**.\n\n4. In **New principals**, enter the email address of a new principal.\n\n5. Select the desired role from the drop-down menu: `servicedirectory.admin`,\n `servicedirectory.editor`, or `servicedirectory.viewer`\n\n6. Click **Save**.\n\n7. Verify that the principal is listed with the role that you granted.\n\nService Directory zones override IAM restrictions\n-------------------------------------------------\n\nWhen assigning a namespace to a Service Directory zone, the service names\nbecome visible to all clients on any networks that are authorized to\nquery the private zone. There is no IAM access control for DNS as\nthe DNS protocol does not provide authentication capability.\n\nWhat's next\n-----------\n\n- See the [IAM documentation](/iam/docs) for details on Identity and Access Management\n- See the [Overview](/service-directory/docs/overview) for an understanding of Service Directory."]]