Including repo.role for non admins to allow rebuild button to display

This commit is contained in:
Andy Gardner 2015-02-25 16:38:22 +02:00
parent 3f873af78f
commit 9ab07d7cd7

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
}