mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
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
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user