summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/user/star.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/user/star.go')
-rw-r--r--routers/api/v1/user/star.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/routers/api/v1/user/star.go b/routers/api/v1/user/star.go
index c856ecefdd..0937fd1903 100644
--- a/routers/api/v1/user/star.go
+++ b/routers/api/v1/user/star.go
@@ -18,9 +18,17 @@ func getStarredRepos(userID int64, private bool) ([]*api.Repository, error) {
if err != nil {
return nil, err
}
+ user, err := models.GetUserByID(userID)
+ if err != nil {
+ return nil, err
+ }
repos := make([]*api.Repository, len(starredRepos))
for i, starred := range starredRepos {
- repos[i] = starred.APIFormat(&api.Permission{true, true, true})
+ access, err := models.AccessLevel(user, starred)
+ if err != nil {
+ return nil, err
+ }
+ repos[i] = starred.APIFormat(access)
}
return repos, nil
}