mirror of
https://github.com/go-gitea/gitea.git
synced 2024-12-18 19:39:33 +01:00
This commit is contained in:
parent
3a9039bc95
commit
0c7e44fcf7
@ -319,6 +319,11 @@ func prepareForReplaceOrAdd(ctx *context.APIContext, form api.IssueLabelsOption)
|
|||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) {
|
||||||
|
ctx.Error(http.StatusForbidden, "CanWriteIssuesOrPulls", "write permission is required")
|
||||||
|
return nil, nil, fmt.Errorf("permission denied")
|
||||||
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
labelIDs []int64
|
labelIDs []int64
|
||||||
labelNames []string
|
labelNames []string
|
||||||
@ -350,10 +355,5 @@ func prepareForReplaceOrAdd(ctx *context.APIContext, form api.IssueLabelsOption)
|
|||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if !ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull) {
|
|
||||||
ctx.Status(http.StatusForbidden)
|
|
||||||
return nil, nil, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return issue, labels, err
|
return issue, labels, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user