mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-17 11:59:30 +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:
parent
faf4b503b2
commit
1a5fe4326f
6 changed files with 71 additions and 80 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue