Stash: Branch permission set via REST API not working

Brainshack February 8, 2015

Hello,

when I set branch-permissions for my repository using the REST Api, users are still able to push directly to the branch, even if they shouldn't. In the stash UI, permissions are displayed like they should. When I resave the permissions manually, without making any modifications, the restrictions work as expected. Is this a bug in stash (using the latest version) or do I need to do something to make my changes actually apply?

2 answers

1 accepted

1 vote
Answer accepted
Brainshack February 8, 2015

Oh now I see what I did wrong. I didnt use fully qualified branch names. Instead of refs/head/master I just used "master"

1 vote
Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 8, 2015

For me this:

curl -i -u user:pass -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d "{\"type\": \"BRANCH\",\"value\": \"refs/heads/something\",\"groups\":[\"Group\"],\"users\":[\"user1\",\"user2\",\"user3\",\"user4\",\"user5\"]}" http://stash/rest/branch-permissions/1.0/projects/PROJECT/repos/REPO/restricted

works perfectly, with Stash 3.5.1

Can you post the exact command and your Stash version?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events