mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 12:37:14 -04:00 
			
		
		
		
	Fix #183
This commit is contained in:
		| @@ -99,6 +99,11 @@ func RepoAssignment(redirect bool, args ...bool) martini.Handler { | |||||||
| 			return | 			return | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | 		// Check if the mirror repository owner(mirror repository doesn't have access). | ||||||
|  | 		if !ctx.Repo.IsOwner && repo.OwnerId == ctx.User.Id { | ||||||
|  | 			ctx.Repo.IsOwner = true | ||||||
|  | 		} | ||||||
|  |  | ||||||
| 		// Check access. | 		// Check access. | ||||||
| 		if repo.IsPrivate && !ctx.Repo.IsOwner { | 		if repo.IsPrivate && !ctx.Repo.IsOwner { | ||||||
| 			if ctx.User == nil { | 			if ctx.User == nil { | ||||||
|   | |||||||
| @@ -83,6 +83,9 @@ func SettingPost(ctx *middleware.Context, form auth.RepoSettingForm) { | |||||||
| 		if len(ctx.Repo.Repository.Name) == 0 || ctx.Repo.Repository.Name != ctx.Query("repository") { | 		if len(ctx.Repo.Repository.Name) == 0 || ctx.Repo.Repository.Name != ctx.Query("repository") { | ||||||
| 			ctx.RenderWithErr("Please make sure you entered repository name is correct.", "repo/setting", nil) | 			ctx.RenderWithErr("Please make sure you entered repository name is correct.", "repo/setting", nil) | ||||||
| 			return | 			return | ||||||
|  | 		} else if ctx.Repo.Repository.IsMirror { | ||||||
|  | 			ctx.Error(404) | ||||||
|  | 			return | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		newOwner := ctx.Query("owner") | 		newOwner := ctx.Query("owner") | ||||||
|   | |||||||
| @@ -235,8 +235,7 @@ func Issues(ctx *middleware.Context) { | |||||||
| 			return | 			return | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		err = issues[i].Repo.GetOwner() | 		if err = issues[i].Repo.GetOwner(); err != nil { | ||||||
| 		if err != nil { |  | ||||||
| 			ctx.Handle(500, "user.Issues(GetOwner)", err) | 			ctx.Handle(500, "user.Issues(GetOwner)", err) | ||||||
| 			return | 			return | ||||||
| 		} | 		} | ||||||
|   | |||||||
| @@ -88,6 +88,7 @@ | |||||||
|                 Danger Zone |                 Danger Zone | ||||||
|             </div> |             </div> | ||||||
|              |              | ||||||
|  |             {{if not .Repository.IsMirror}} | ||||||
|             <div class="panel-body"> |             <div class="panel-body"> | ||||||
|                 <button type="button" class="btn btn-default pull-right" href="#transfer-repository-modal" data-toggle="modal"> |                 <button type="button" class="btn btn-default pull-right" href="#transfer-repository-modal" data-toggle="modal"> | ||||||
|                     Transfer ownership  |                     Transfer ownership  | ||||||
| @@ -137,6 +138,8 @@ | |||||||
|                     </div> |                     </div> | ||||||
|                 </div> |                 </div> | ||||||
|             </div> |             </div> | ||||||
|  |             {{end}} | ||||||
|  |              | ||||||
|             <hr> |             <hr> | ||||||
|             <div class="panel-body"> |             <div class="panel-body"> | ||||||
|                 <button type="button" class="btn btn-default pull-right" href="#delete-repository-modal" data-toggle="modal"> |                 <button type="button" class="btn btn-default pull-right" href="#delete-repository-modal" data-toggle="modal"> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user