change error message for non member of organization to be forbidden instead of not found:
This commit is contained in:
parent
fe9ea60aad
commit
00f65ec289
1 changed files with 3 additions and 3 deletions
|
@ -58,7 +58,7 @@ func CheckMembership(service core.OrganizationService, admin bool) func(http.Han
|
||||||
|
|
||||||
isMember, isAdmin, err := service.Membership(ctx, user, namespace)
|
isMember, isAdmin, err := service.Membership(ctx, user, namespace)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
render.Unauthorized(w, errors.ErrNotFound)
|
render.Unauthorized(w, errors.ErrForbidden)
|
||||||
log.Debugln("api: organization membership not found")
|
log.Debugln("api: organization membership not found")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -68,13 +68,13 @@ func CheckMembership(service core.OrganizationService, admin bool) func(http.Han
|
||||||
WithField("organization.admin", isAdmin)
|
WithField("organization.admin", isAdmin)
|
||||||
|
|
||||||
if isMember == false {
|
if isMember == false {
|
||||||
render.Unauthorized(w, errors.ErrNotFound)
|
render.Unauthorized(w, errors.ErrForbidden)
|
||||||
log.Debugln("api: organization membership is required")
|
log.Debugln("api: organization membership is required")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if isAdmin == false && admin == true {
|
if isAdmin == false && admin == true {
|
||||||
render.Unauthorized(w, errors.ErrNotFound)
|
render.Unauthorized(w, errors.ErrForbidden)
|
||||||
log.Debugln("api: organization administrator is required")
|
log.Debugln("api: organization administrator is required")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue