Merge pull request #899 from andy-g/fix_rebuild_button_display

Displaying rebuild button for users with write access to the repo (not necessarily admins)
This commit is contained in:
Brad Rydzewski 2015-02-26 01:28:28 -07:00
commit b9383265a4

View file

@ -30,7 +30,10 @@ func GetRepo(c web.C, w http.ResponseWriter, r *http.Request) {
// if the user is not requesting (or cannot access)
// admin data then we just return the repo as-is
if role.Admin == false {
json.NewEncoder(w).Encode(repo)
json.NewEncoder(w).Encode(struct {
*model.Repo
Perm *model.Perm `json:"role"`
}{repo, role})
return
}