List all permissions and users of Repositories in Bitbucket
Important Note on DB Queries
This Database Query / Functionality is not officially supported!
- Atlassian is not responsible for translating queries for different databases.
- This query should only be used as an example. Any desired adjustments should be checked with your local Database Administrator, including queries related to different DBMS that are not present/listed in this KB article, like Oracle Database.
- Atlassian will not be providing support for changes, adjustments, or inquiries regarding the below queries, as this is not part of our Atlassian Support Offerings.
- Atlassian does not provide any support to sample database queries provided in our Knowledge Base documents. Extraction of data from Bitbucket should be performed using our REST API Documentation because we do not keep all data relationships in the DB. Many connections to data are handled in the code. The REST API can go through the code paths to get the data. A SQL would have to do that manually or, in some cases, it can’t be done at all.
The following SQL query provides a list of users and groups related to repositories in Bitbucket. This query has been tested with PostgreSQL.
- SQL query for providing a list of repositories with their
assigned users
- SQL query for providing the list of repositories with their
active assigned users
The result shows users that have access through a group and users that have individual access to repositories
View information about directories
select directory_name,
description,
created_date,
directory_type
from cwd_directory
select directory_name,
description,
created_date,
directory_type
from dbo.cwd_directory
Reported Issue
If you are having issues with permission on objects, when you run the queries in MS SQL, you will need to enable mapping with the master database through the database properties as shown in the image below.