summaryrefslogtreecommitdiffstats
path: root/routers/api
diff options
context:
space:
mode:
authorBwko <bouwko@gmail.com>2017-08-23 03:30:54 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2017-08-23 09:30:54 +0800
commit1a5fe4326f1166eac447cb598db34f7ae348d610 (patch)
tree0ca4412138469051eda63a981b32353e2139698e /routers/api
parentfaf4b503b24d33a2a0f455d26bb782345ab8e0c9 (diff)
downloadgitea-1a5fe4326f1166eac447cb598db34f7ae348d610.tar.gz
gitea-1a5fe4326f1166eac447cb598db34f7ae348d610.zip
Add collaborative repositories to the dashboard (#2205)
* Add collaborative repositories to the dashboard Remove some unused code from the Dashboard func * fix some bug and some refactor * fix tests
Diffstat (limited to 'routers/api')
-rw-r--r--routers/api/v1/repo/repo.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index e8bf026511..305daa064d 100644
--- a/routers/api/v1/repo/repo.go
+++ b/routers/api/v1/repo/repo.go
@@ -42,6 +42,7 @@ func Search(ctx *context.APIContext) {
if ctx.IsSigned && opts.OwnerID > 0 {
if ctx.User.ID == opts.OwnerID {
opts.Private = true
+ opts.Collaborate = true
} else {
u, err := models.GetUserByID(opts.OwnerID)
if err != nil {
@@ -54,7 +55,10 @@ func Search(ctx *context.APIContext) {
if u.IsOrganization() && u.IsOwnedBy(ctx.User.ID) {
opts.Private = true
}
- // FIXME: how about collaborators?
+
+ if !u.IsOrganization() {
+ opts.Collaborate = true
+ }
}
}