mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 12:26:05 +01:00 
			
		
		
		
	fix #1997
This commit is contained in:
		
							
								
								
									
										2
									
								
								gogs.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								gogs.go
									
									
									
									
									
								
							@@ -17,7 +17,7 @@ import (
 | 
			
		||||
	"github.com/gogits/gogs/modules/setting"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
const APP_VER = "0.7.18.1118 Beta"
 | 
			
		||||
const APP_VER = "0.7.18.1119 Beta"
 | 
			
		||||
 | 
			
		||||
func init() {
 | 
			
		||||
	runtime.GOMAXPROCS(runtime.NumCPU())
 | 
			
		||||
 
 | 
			
		||||
@@ -36,7 +36,10 @@ func accessLevel(e Engine, u *User, repo *Repository) (AccessMode, error) {
 | 
			
		||||
		mode = ACCESS_MODE_READ
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if u != nil {
 | 
			
		||||
	if u == nil {
 | 
			
		||||
		return mode, nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if u.Id == repo.OwnerID {
 | 
			
		||||
		return ACCESS_MODE_OWNER, nil
 | 
			
		||||
	}
 | 
			
		||||
@@ -46,9 +49,6 @@ func accessLevel(e Engine, u *User, repo *Repository) (AccessMode, error) {
 | 
			
		||||
		return mode, err
 | 
			
		||||
	}
 | 
			
		||||
	return a.Mode, nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return mode, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// AccessLevel returns the Access a user has to a repository. Will return NoneAccess if the
 | 
			
		||||
 
 | 
			
		||||
@@ -275,7 +275,7 @@ func RepoAssignment(redirect bool, args ...bool) macaron.Handler {
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// Admin has super access.
 | 
			
		||||
		if ctx.User.IsAdmin {
 | 
			
		||||
		if ctx.IsSigned && ctx.User.IsAdmin {
 | 
			
		||||
			ctx.Repo.AccessMode = models.ACCESS_MODE_OWNER
 | 
			
		||||
		} else {
 | 
			
		||||
			mode, err := models.AccessLevel(ctx.User, repo)
 | 
			
		||||
 
 | 
			
		||||
@@ -1 +1 @@
 | 
			
		||||
0.7.18.1118 Beta
 | 
			
		||||
0.7.18.1119 Beta
 | 
			
		||||
		Reference in New Issue
	
	Block a user