mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-06 23:38:48 +02:00
routers/api/v1/repo/issue.go: prohibit set of due date for restricted users in swagger API
This commit is contained in:
parent
c945223a5e
commit
793b45d1d6
@ -845,6 +845,11 @@ func EditIssue(ctx *context.APIContext) {
|
||||
|
||||
// Update or remove the deadline, only if set and allowed
|
||||
if (form.Deadline != nil || form.RemoveDeadline != nil) && canWrite {
|
||||
if ctx.Doer.IsRestricted && !setting.RestrictedUser.AllowEditDueDate {
|
||||
ctx.APIError(http.StatusForbidden, "restricted users cannot modify due dates")
|
||||
return
|
||||
}
|
||||
|
||||
var deadlineUnix timeutil.TimeStamp
|
||||
|
||||
if form.RemoveDeadline == nil || !*form.RemoveDeadline {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user