From d521e716dd59617dbbb637a3e8028bf4a5c6f849 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 16 Feb 2017 16:33:49 -0500 Subject: refactoring: SSH and HTTP push procees is now unified We used to handle SSH and HTTP push separately which produces duplicated code, but now with post-receive hook, the process is unified to one single place and much cleaner. Thus, UpdateTask struct is removed. Narrow down the range of Git HTTP routes to reduce condufsing HTTP Basic Authentication window popup on browser. By detecting inside post-receive hook, Git HTTP doesn't need to read the whole content body anymore, which completely solve the RAM problem reported in #636. --- models/access.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'models/access.go') diff --git a/models/access.go b/models/access.go index 43a51775..0b114376 100644 --- a/models/access.go +++ b/models/access.go @@ -86,7 +86,7 @@ func AccessLevel(u *User, repo *Repository) (AccessMode, error) { func hasAccess(e Engine, u *User, repo *Repository, testMode AccessMode) (bool, error) { mode, err := accessLevel(e, u, repo) - return testMode <= mode, err + return mode >= testMode, err } // HasAccess returns true if someone has the request access level. User can be nil! -- cgit v1.2.3