提交 abc9a6ff 编写于 作者: U UlricQin

Merge branch 'master' of https://github.com/didi/nightingale

......@@ -259,6 +259,12 @@ func eventHisGets(c *gin.Context) {
func eventCurDel(c *gin.Context) {
eventCur := mustEventCur(urlParamInt64(c, "id"))
can, err := models.UsernameCandoNodeOp(loginUsername(c), "mon_event_write", eventCur.Nid)
errors.Dangerous(err)
if !can {
errors.Bomb(_s("no privilege"))
}
renderMessage(c, eventCur.EventIgnore())
}
......@@ -404,6 +410,13 @@ func eventCurClaim(c *gin.Context) {
var f claimForm
errors.Dangerous(c.ShouldBind(&f))
eventCur := mustEventCur(f.Id)
can, err := models.UsernameCandoNodeOp(username, "mon_event_write", eventCur.Nid)
errors.Dangerous(err)
if !can {
errors.Bomb(_s("no privilege"))
}
id := f.Id
nodePath := f.NodePath
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册