index
:
gogs.git
Gogs is a painless self-hosted Git service
log msg
author
committer
range
buildscript
main
mygogs
about
summary
refs
log
tree
commit
diff
path:
root
/
models
/
access.go
diff options
context:
1
2
3
4
5
6
7
8
9
10
15
20
25
30
35
40
space:
include
ignore
mode:
unified
ssdiff
stat only
author
Unknown <joe2010xtmf@163.com>
2014-05-08 19:17:43 -0400
committer
Unknown <joe2010xtmf@163.com>
2014-05-08 19:17:43 -0400
commit
914ffa496f8e8e9948ca8c5596da6b0d3c17555d
(
patch
)
tree
5f2fc88ee51db05013f968031bc8340f4867f48d
/
models/access.go
parent
a742ee543ef3faf6374625c9c6d065c0a46b5549
(
diff
)
Show private repository activities in dashboard if has access
Diffstat
(limited to 'models/access.go')
-rw-r--r--
models/access.go
3
1 files changed, 3 insertions, 0 deletions
diff --git a/models/access.go b/models/access.go
index 4f944517..4a202dc6 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 <username>/<reponame>.
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),