-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix to allow comment poster to edit or delete his own comments #11671
Conversation
No the ui only allow poster to update or delet comment, which is not reasonable and different with handle logic, this pr change it to allow poster of comment do it ref code: https://github.com/go-gitea/gitea/blob/e8955173a9be1acaa9a3755c37b6059422acda20/routers/repo/issue.go#L1636 https://github.com/go-gitea/gitea/blob/e8955173a9be1acaa9a3755c37b6059422acda20/routers/repo/issue.go#L1681 fix go-gitea#11663 Signed-off-by: a1012112796 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be better to add function to context.go:
// IsUser returns true if current user is specified one
func (ctx *Context) IsUser(id int64) bool {
return ctx.IsSigned && (ctx.User.ID == id)
}
@lafriks I think this style is simpler. Do you think so? Thanks. |
Yes, loogs good now |
What needs to be verified is if |
Please review, Thanks :) |
didnt this worked before too?!? |
No, I have checked, Sadly it can't because of a difference between template file and golang file. Maybe you haven't focused on it because you are admin :) , Thanks |
make lg-tm work |
make it work |
Please send backport |
…tea#11671) * bug: fix comment update permision check No the ui only allow poster to update or delet comment, which is not reasonable and different with handle logic, this pr change it to allow poster of comment do it ref code: https://github.com/go-gitea/gitea/blob/e8955173a9be1acaa9a3755c37b6059422acda20/routers/repo/issue.go#L1636 https://github.com/go-gitea/gitea/blob/e8955173a9be1acaa9a3755c37b6059422acda20/routers/repo/issue.go#L1681 fix go-gitea#11663 Signed-off-by: a1012112796 <[email protected]> * simplify code * fix sign in Co-authored-by: zeripath <[email protected]> Co-authored-by: Lauris BH <[email protected]>
… (#11774) * bug: fix comment update permision check No the ui only allow poster to update or delet comment, which is not reasonable and different with handle logic, this pr change it to allow poster of comment do it ref code: https://github.com/go-gitea/gitea/blob/e8955173a9be1acaa9a3755c37b6059422acda20/routers/repo/issue.go#L1636 https://github.com/go-gitea/gitea/blob/e8955173a9be1acaa9a3755c37b6059422acda20/routers/repo/issue.go#L1681 fix #11663 Signed-off-by: a1012112796 <[email protected]> * simplify code * fix sign in Co-authored-by: zeripath <[email protected]> Co-authored-by: Lauris BH <[email protected]> Co-authored-by: zeripath <[email protected]> Co-authored-by: Lauris BH <[email protected]>
…tea#11671) * bug: fix comment update permision check No the ui only allow poster to update or delet comment, which is not reasonable and different with handle logic, this pr change it to allow poster of comment do it ref code: https://github.com/go-gitea/gitea/blob/e8955173a9be1acaa9a3755c37b6059422acda20/routers/repo/issue.go#L1636 https://github.com/go-gitea/gitea/blob/e8955173a9be1acaa9a3755c37b6059422acda20/routers/repo/issue.go#L1681 fix go-gitea#11663 Signed-off-by: a1012112796 <[email protected]> * simplify code * fix sign in Co-authored-by: zeripath <[email protected]> Co-authored-by: Lauris BH <[email protected]>
Now the ui only allow poster to update or delet comment, which is not reasonable and different with handle logic, this pr change it to allow poster of comment do it.
ref code:
gitea/routers/repo/issue.go
Line 1636 in e895517
gitea/routers/repo/issue.go
Line 1681 in e895517
fix #11663