mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-22 07:18:31 -04:00
Use handlers for API authorization (#723)
This commit is contained in:
parent
067ae5d96e
commit
d1b5498cc0
5 changed files with 100 additions and 131 deletions
|
@ -52,11 +52,6 @@ func Get(ctx *context.APIContext) {
|
|||
// see https://github.com/gogits/go-gogs-client/wiki/Organizations#edit-an-organization
|
||||
func Edit(ctx *context.APIContext, form api.EditOrgOption) {
|
||||
org := ctx.Org.Organization
|
||||
if !org.IsOwnedBy(ctx.User.ID) {
|
||||
ctx.Status(403)
|
||||
return
|
||||
}
|
||||
|
||||
org.FullName = form.FullName
|
||||
org.Description = form.Description
|
||||
org.Website = form.Website
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue