Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Checking Admin Permissions for Triggering Custom Pipelines via API

Edited

 Hello,

I'm setting up a custom pipeline in Bitbucket and need to verify whether the user who triggers the pipeline has admin permissions. I attempted to check permissions with an API call to:

GET https://api.bitbucket.org/2.0/repositories/$BITBUCKET_REPO_OWNER/$BITBUCKET_REPO_SLUG/permissions-config/users/$BITBUCKET_STEP_TRIGGERER_UUID

However, this returns no data since users have been added to the repository as part of a group, not individually. How can I check if the pipeline triggerer is an admin, especially when permissions are assigned via groups?

I need to resolve this promptly to proceed with pipeline configuration. Any assistance would be greatly appreciated.

Thanks!

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Nov 08, 2023

Hi @Vish!

If permissions are assigned only via groups, you can first use the following API endpoint to list group permissions for this repo:

The field you need to look at in the output for each group is the permission (and not the default_permission, as the latter may be different than the actual permission). This way you can filter which groups have admin permissions to this repo.

Afterwards, you can use the following API endpoint from version 1 of our API to get group members for each group that has admin permission to the repo:

You will then have a list of users with admin permission to the repo. You can then check if the UUID of the user that triggered the pipeline belongs in that list.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events