Mulai 17 Juni 2024, Cloud Source Repositories tidak tersedia untuk pelanggan baru. Jika organisasi Anda belum pernah menggunakan Cloud Source Repositories, Anda tidak dapat mengaktifkan API atau menggunakan Cloud Source Repositories. Project baru yang tidak terhubung ke organisasi tidak dapat mengaktifkan Cloud Source Repositories API. Organisasi yang telah menggunakan Repositori Sumber Cloud sebelum 17 Juni 2024 tidak akan terpengaruh oleh perubahan ini.
Memberikan akses pengguna ke repositori dan project
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Topik ini menjelaskan cara Anda dapat memberi pengguna akses ke repositori dan
project, serta tindakan yang dapat dilakukan pengguna tersebut. Contoh tindakan pengguna
mencakup hal berikut:
Pengguna dengan tingkat izin ini dapat mendorong perubahan ke repositori. Mereka juga dapat
melakukan semua tindakan yang dijelaskan dalam
Melihat repositori.
Jika diberi izin ini di level project, pengguna dapat mendorong perubahan ke semua repositori dalam project tersebut.
Memberikan izin push untuk repositori
Konsol
Di Google Cloud console, buka Cloud Source Repositories di tab tampilan My source
Klik nama repositori.
Tampilan File akan terbuka.
Klik
Setelansettings.
Halaman Setelan umum akan terbuka.
Klik Izin.
Halaman Izin akan terbuka.
Di kolom Anggota, masukkan alamat email pengguna.
Di menu drop-down Role, pilih
Source repository > Source Repository Writer.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-11 UTC."],[],[],null,["# Granting user access to repositories and projects\n\nThis topic describes how you can provide users access to repositories and\nprojects, and what actions those users can take. Examples of user actions\ninclude the following:\n\n- Listing repositories\n- Creating new repositories\n- Updating repositories\n\nFor a complete list of actions, see\n[Roles and permissions matrix](/source-repositories/docs/configure-access-control#roles_and_permissions_matrix).\n\nGrant permissions to view repositories\n--------------------------------------\n\nUsers with this level of permissions can view the contents of a repository. They\ncan also clone and fetch the repository.\n\nIf granted this permission at the project level, users can view all repositories\nfor that project.\n\n### Grant viewing permissions for a repository\n\n### Console\n\n1. In the Google Cloud console, open Cloud Source Repositories in the [My source](https://source.cloud.google.com/) view tab\n\n2. Click the name of a repository.\n\n The **Files** view opens.\n3. Click\n **Settings** *settings*.\n\n The **General settings** page opens.\n4. Click **Permissions**.\n\n The **Permissions** page opens.\n5. In the **Members** field, enter the user's email address.\n\n6. In the **Role** drop-down list, select\n **Source repository \\\u003e Source Repository Reader**.\n\n7. Click **Add**.\n\n### Command line\n\n1. Open a terminal window.\n\n2. Enter the following command:\n\n gcloud source repos set-iam-policy [REPO_NAME] [POLICY_FILE] [GCLOUD_WIDE_FLAG ...]\n\n Where:\n - `[REPO_NAME]` is the name of the repository.\n - `[POLICY_FILE]` is the JSON or YAML file with the Identity and Access Management policy.\n\nFor more information on this command, see\n[gcloud source repos set-iam-policy](/sdk/gcloud/reference/source/repos/set-iam-policy).\n\n### Grant viewing permissions across a project\n\n### Console\n\n1. In the Google Cloud console, open Cloud Source Repositories in the [My source](https://source.cloud.google.com/) view tab\n\n2. Click the name of a Google Cloud project ID for a specific repository.\n\n The page displays a list of all repositories for that project.\n3. Click\n **Settings** *settings*.\n\n The **General settings** page opens.\n4. Click **Permissions**.\n\n The **Permissions** page opens.\n5. In the **Members** field, enter the user's email address.\n\n6. In the **Role** drop-down list, select\n **Source repository \\\u003e Source Repository Reader**.\n\n7. Click **Add**.\n\n### Command line\n\n1. Open a terminal window.\n\n2. Enter the following command:\n\n gcloud projects add-iam-policy-binding [PROJECT_ID] --member=[MEMBER] \\\n --role=[ROLE] [GCLOUD_WIDE_FLAG ...]\n\n Where:\n - `[PROJECT_ID]` is the ID for your Google Cloud project.\n - `[MEMBER]` is the user you want to add.\n - `[ROLE]` is the IAM role you want to assign.\n\nFor more information on this command, see\n[gcloud projects add-iam-policy-binding](/sdk/gcloud/reference/projects/add-iam-policy-binding).\n\nGrant permissions to push commits\n---------------------------------\n\nUsers with this level of permissions can push changes to a repository. They can\nalso perform all the actions described in\n[Viewing repositories](#viewing_repositories).\n\nIf granted this permission at the project level, users can push changes\nto all repositories in that project.\n\n### Grant push permissions for a repository\n\n### Console\n\n1. In the Google Cloud console, open Cloud Source Repositories in the [My source](https://source.cloud.google.com/) view tab\n\n2. Click the name of a repository.\n\n The **Files** view opens.\n3. Click\n **Settings** *settings*.\n\n The **General settings** page opens.\n4. Click **Permissions**.\n\n The **Permissions** page opens.\n5. In the **Members** field, enter the user's email address.\n\n6. In the **Role** drop-down list, select\n **Source repository \\\u003e Source Repository Writer**.\n\n7. Click **Add**.\n\n### Command line\n\n1. Open a terminal window.\n\n2. Enter the following command:\n\n gcloud source repos set-iam-policy [REPO_NAME] [POLICY_FILE] [GCLOUD_WIDE_FLAG ...]\n\n Where:\n - `[REPO_NAME]` is the name of the repository.\n - `[POLICY_FILE]` is the JSON or YAML file with the IAM policy.\n\nFor more information on this command, see\n[gcloud source repos set-iam-policy](/sdk/gcloud/reference/source/repos/set-iam-policy).\n\n### Grant push permissions for a project\n\n### Console\n\n1. In the Google Cloud console, open Cloud Source Repositories in the [My source](https://source.cloud.google.com/) view tab\n\n2. Click the name of a Google Cloud project ID for a specific\n repository.\n\n The page displays a list of all repositories for that project.\n3. Click\n **Settings** *settings*.\n\n The **General settings** page opens.\n4. Click **Permissions**.\n\n The **Permissions** page opens.\n5. In the **Members** field, enter the user's email address .\n\n6. In the **Role** drop-down list, select\n **Source Repository \\\u003e Source Repository Writer**.\n\n7. Click **Add**.\n\n### Command line\n\n1. Open a terminal window.\n\n2. Enter the following command:\n\n gcloud projects add-iam-policy-binding [PROJECT_ID] --member=[MEMBER] \\\n --role=[ROLE] [GCLOUD_WIDE_FLAG ...]\n\n Where:\n - `[PROJECT_ID]` is the ID for your Google Cloud project.\n - `[MEMBER]` is the user you want to add.\n - `[ROLE]` is the IAM role you want to assign.\n\nFor more information on this command, see\n[gcloud projects add-iam-policy-binding](/sdk/gcloud/reference/projects/add-iam-policy-binding).\n\nGrant permissions to create and delete repositories\n---------------------------------------------------\n\n\u003cbr /\u003e\n\nIf granted this permission at the project level, users can create, update, and\ndelete repositories for the entire project.\n\n1. In the Google Cloud console, open Cloud Source Repositories in the [My source](https://source.cloud.google.com/) view tab\n\n2. Click the name of a Google Cloud project ID for a specific repository.\n\n The page displays a list of all repositories for that project.\n3. Click\n **Settings** *settings*.\n\n The **General settings** page opens.\n4. Click **Permissions**.\n\n The **Permissions** page opens.\n5. In the **Members** field, enter the user's email address.\n\n6. In the **Role** drop-down list, select\n **Source repository \\\u003e Source Repository Administrator**.\n\n7. Click **Add**.\n\nRemove a user's access\n----------------------\n\nThere may be cases where you need to remove a user's access to a repository or\nproject.\n\n### Remove access to a repository\n\n1. In the Google Cloud console, open Cloud Source Repositories in the [My source](https://source.cloud.google.com/) view tab\n\n2. Click on the name of a repository.\n\n The **Files** view opens.\n3. Click\n **Settings** *settings*.\n\n The **General settings** page opens.\n4. Click **Permissions**.\n\n5. Locate the role you want to remove, and then click\n **Delete** *delete*\n for that role.\n\n A confirmation dialog opens.\n6. Click **Remove**.\n\n### Remove access to a project\n\n1. In the Google Cloud console, open Cloud Source Repositories in the [My source](https://source.cloud.google.com/) view tab\n\n2. Click the name of a Google Cloud project ID for a specific repository.\n\n The page displays a list of all repositories for that project.\n3. Click\n **Settings** *settings*.\n\n The **General settings** page opens.\n4. Click **Permissions**.\n\n The **Permissions** page opens.\n5. Locate the role you want to remove, and then click\n **Delete** *delete*\n for that role.\n\n A confirmation dialog opens.\n6. Click **Remove**.\n\nWhat's next\n-----------\n\n- Learn more about\n [Cloud Source Repositories and access control](/source-repositories/docs/configure-access-control).\n\n- Learn more about [IAM](/iam/docs)."]]