You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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:
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.
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.