go-bitbucket icon indicating copy to clipboard operation
go-bitbucket copied to clipboard

400 Bad Request when setting branch permissions using groups

Open maikeffi opened this issue 4 years ago • 2 comments

When setting branch permissions restrict_merges am passing map[string]string{"admin": "administrator", "dev": "developer"} as the BranchRestrictionsOptions.Groups value . It throws an error 400 Bad Request and sets the permission group to Everybody

maikeffi avatar Apr 21 '21 03:04 maikeffi

Why are we passing a map and not a array of strings like Users . The buildBranchRestrictionsBody in BranchRestrictions.Create does not use the key value of the maps . Another Observation was branchRestrictionsBodyGroup uses the field Name When i used slug manually adding the restriction it seemed to work

"groups":[ { "slug":"developers" }, { "slug":"administrators" } ]

maikeffi avatar Apr 21 '21 03:04 maikeffi

Oh. Surely I created the struct and method. But, maybe the rules of Atlassian's bitbucket api have changed over the years.

ktrysmt avatar Apr 21 '21 14:04 ktrysmt