Show private repository activities in dashboard if has access
This commit is contained in:
parent
a742ee543e
commit
914ffa496f
6 changed files with 54 additions and 13 deletions
|
@ -50,7 +50,7 @@ func RepoAssignment(redirect bool, args ...bool) martini.Handler {
|
|||
|
||||
// Collaborators who have write access can be seen as owners.
|
||||
if ctx.IsSigned {
|
||||
ctx.Repo.IsOwner, err = models.HasAccess(ctx.User.Name, repoName, models.AU_WRITABLE)
|
||||
ctx.Repo.IsOwner, err = models.HasAccess(ctx.User.Name, userName+"/"+repoName, models.AU_WRITABLE)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "RepoAssignment(HasAccess)", err)
|
||||
return
|
||||
|
@ -100,7 +100,7 @@ func RepoAssignment(redirect bool, args ...bool) martini.Handler {
|
|||
}
|
||||
|
||||
// Check access.
|
||||
if repo.IsPrivate {
|
||||
if repo.IsPrivate && !ctx.Repo.IsOwner {
|
||||
if ctx.User == nil {
|
||||
ctx.Handle(404, "RepoAssignment(HasAccess)", nil)
|
||||
return
|
||||
|
|
10
modules/workers/worker.go
Normal file
10
modules/workers/worker.go
Normal file
|
@ -0,0 +1,10 @@
|
|||
// Copyright 2014 The Gogs Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package workers
|
||||
|
||||
// Work represents a background work interface of any kind.
|
||||
type Work interface {
|
||||
Do() error
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue