How to give read-only access to a group for the entire workspace?
Asked by Yariel Quintana:

Is there a way to provide read-only access across the entire workspace without having to do it project by project?.


Answers:
author: Patrik S
body: Hello [@Yariel Quintana](/t5/user/viewprofilepage/user-id/5178779) and thank you for reaching out to Community!

Since the release of project permission, the simplest way of adding read access across all the workspace would be to [create a user group](https://support.atlassian.com/bitbucket-cloud/docs/organize-groups-for-your-repositories/#Create-a-new-user-group), and assign this user group read permissions to each of the project workspace.

To add the user group to a project you can follow the below steps :   

1. Select the **Projects** tab on the top navigation bar to display a list of projects within the current workspace.
2. Select the project you want to add the user/user group to
3. Select **Project settings** on the left sidebar.
4. Select **Project permissions** under the General heading on left sidebar.
5. Select **Add users or groups** to add a user or group to the project and assign them permissions within the project. Enter the group or user by name or enter the user's email address, if they are not already a member of the workspace.
6. Select the permissions dropdown (it will be **Read**, by default) and select the permission you want to set for this group or user.
7. Select Confirm to save your updates.

Once the read permission is given at the project level, this will be inherited by all the repos within that project. This just needs to be done once, meaning that new users added to that user group in the future will receive the read permission to all the projects (and their repos) where the group was added.

Hope that helps! Let us know in case you have any questions.

Thank you, [@Yariel Quintana](/t5/user/viewprofilepage/user-id/5178779) !  
Patrik S

comments: author: Yariel Quintana
body: Thank you for your response, [@Patrik S](/t5/user/viewprofilepage/user-id/4603309) !

I understand that I can assign permissions to a user group in a specific project. However, my question is focused on the mass assignment of read-only permissions to a group across all projects in my workspace. The current configuration seems to require me to assign these permissions project by project, which is a time-consuming process. Is there any functionality or method that allows the bulk assignment of these permissions at the workspace level for all projects simultaneously?

I appreciate your further assistance and guidance on this matter.

Thank you in advance!


author: Patrik S
body: Hello [@Yariel Quintana](/t5/user/viewprofilepage/user-id/5178779) ,

I'm afraid there's not currently an option in the UI to bulk assign permissions to groups across all the projects in the workspace.

An alternative would be to create a script that leverages the Bitbucket API to achieve this task :

* Use the [List project in a workspace](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-workspaces-workspace-projects-get) endpoint to get a list of all the projects in your workspace
* For each of the projects, grant the read permission by calling the [Update an explicit group permission for a project](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-projects/#api-workspaces-workspace-projects-project-key-permissions-config-groups-group-slug-put) :  

  Example request to assign read permission :

  ```
  curl --request PUT -u USERNAME:APP_PASSWORD --url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/projects/{project_key}/permissions-config/groups/{group_slug}' --header 'Accept: application/json' --header 'Content-Type: application/json' --data '{ "permission": "read" }'
  ```

You can reference the [Bitbucket Cloud API](https://developer.atlassian.com/cloud/bitbucket/rest/intro/) documentation for additional details on other available endpoints and authentication methods.

Thank you, [@Yariel Quintana](/t5/user/viewprofilepage/user-id/5178779) !

Patrik S


Tags: access

bitbucket-cloud

cloud

group

permission