mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-26 12:27:06 +00:00 
			
		
		
		
	When attempting to subscribe other user to issue report why access denied (#18091)
Fix #18090 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		| @@ -5,6 +5,7 @@ | |||||||
| package repo | package repo | ||||||
|  |  | ||||||
| import ( | import ( | ||||||
|  | 	"fmt" | ||||||
| 	"net/http" | 	"net/http" | ||||||
|  |  | ||||||
| 	"code.gitea.io/gitea/models" | 	"code.gitea.io/gitea/models" | ||||||
| @@ -128,7 +129,7 @@ func setIssueSubscription(ctx *context.APIContext, watch bool) { | |||||||
|  |  | ||||||
| 	//only admin and user for itself can change subscription | 	//only admin and user for itself can change subscription | ||||||
| 	if user.ID != ctx.User.ID && !ctx.User.IsAdmin { | 	if user.ID != ctx.User.ID && !ctx.User.IsAdmin { | ||||||
| 		ctx.Error(http.StatusForbidden, "User", nil) | 		ctx.Error(http.StatusForbidden, "User", fmt.Errorf("%s is not permitted to change subscriptions for %s", ctx.User.Name, user.Name)) | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 zeripath
					zeripath