web/auth: middleware respone with 404
continuous-integration/drone the build was successful
Details
continuous-integration/drone the build was successful
Details
This commit is contained in:
parent
ea2ffbc424
commit
9b2fe62df5
|
@ -39,7 +39,7 @@ func MiddlewarePermissionParam(ws *web.Service, obj HasPermission, param string)
|
||||||
})
|
})
|
||||||
c.Abort()
|
c.Abort()
|
||||||
}
|
}
|
||||||
_, err = obj.HasPermission(ws.DB, userID, objID)
|
d, err := obj.HasPermission(ws.DB, userID, objID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(http.StatusUnauthorized, web.HTTPError{
|
c.JSON(http.StatusUnauthorized, web.HTTPError{
|
||||||
Message: ErrAPINoPermission.Error(),
|
Message: ErrAPINoPermission.Error(),
|
||||||
|
@ -47,5 +47,11 @@ func MiddlewarePermissionParam(ws *web.Service, obj HasPermission, param string)
|
||||||
})
|
})
|
||||||
c.Abort()
|
c.Abort()
|
||||||
}
|
}
|
||||||
|
if d == nil {
|
||||||
|
c.JSON(http.StatusNotFound, web.HTTPError{
|
||||||
|
Message: web.ErrAPINotFound.Error(),
|
||||||
|
})
|
||||||
|
c.Abort()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue