From 914ffa496f8e8e9948ca8c5596da6b0d3c17555d Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 8 May 2014 19:17:43 -0400 Subject: Show private repository activities in dashboard if has access --- models/access.go | 3 +++ models/action.go | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'models') diff --git a/models/access.go b/models/access.go index 4f944517ed..4a202dc6bc 100644 --- a/models/access.go +++ b/models/access.go @@ -60,6 +60,9 @@ func UpdateAccessWithSession(sess *xorm.Session, access *Access) error { // HasAccess returns true if someone can read or write to given repository. // The repoName should be in format /. func HasAccess(uname, repoName string, mode int) (bool, error) { + if len(repoName) == 0 { + return false, nil + } access := &Access{ UserName: strings.ToLower(uname), RepoName: strings.ToLower(repoName), diff --git a/models/action.go b/models/action.go index 02639e5538..6c18d022d0 100644 --- a/models/action.go +++ b/models/action.go @@ -198,8 +198,8 @@ func TransferRepoAction(user, newUser *User, repo *Repository) (err error) { } // GetFeeds returns action list of given user in given context. -func GetFeeds(userid, offset int64, isProfile bool) ([]Action, error) { - actions := make([]Action, 0, 20) +func GetFeeds(userid, offset int64, isProfile bool) ([]*Action, error) { + actions := make([]*Action, 0, 20) sess := orm.Limit(20, int(offset)).Desc("id").Where("user_id=?", userid) if isProfile { sess.Where("is_private=?", false).And("act_user_id=?", userid) -- cgit v1.2.3