|
|
@ -200,7 +200,7 @@ func (m *MessageApi) SendMessage(c *gin.Context) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Check if the user has the app manager role.
|
|
|
|
// Check if the user has the app manager role.
|
|
|
|
if !authverify.IsAppManagerUid(c) {
|
|
|
|
if !authverify.IsAppManagerUid(c, m.Config) {
|
|
|
|
// Respond with a permission error if the user is not an app manager.
|
|
|
|
// Respond with a permission error if the user is not an app manager.
|
|
|
|
apiresp.GinError(c, errs.ErrNoPermission.Wrap("only app manager can send message"))
|
|
|
|
apiresp.GinError(c, errs.ErrNoPermission.Wrap("only app manager can send message"))
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -257,7 +257,7 @@ func (m *MessageApi) SendBusinessNotification(c *gin.Context) {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if !authverify.IsAppManagerUid(c) {
|
|
|
|
if !authverify.IsAppManagerUid(c, m.Config) {
|
|
|
|
apiresp.GinError(c, errs.ErrNoPermission.Wrap("only app manager can send message"))
|
|
|
|
apiresp.GinError(c, errs.ErrNoPermission.Wrap("only app manager can send message"))
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -302,7 +302,7 @@ func (m *MessageApi) BatchSendMsg(c *gin.Context) {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
log.ZInfo(c, "BatchSendMsg", "req", req)
|
|
|
|
log.ZInfo(c, "BatchSendMsg", "req", req)
|
|
|
|
if err := authverify.CheckAdmin(c); err != nil {
|
|
|
|
if err := authverify.CheckAdmin(c, m.Config); err != nil {
|
|
|
|
apiresp.GinError(c, errs.ErrNoPermission.Wrap("only app manager can send message"))
|
|
|
|
apiresp.GinError(c, errs.ErrNoPermission.Wrap("only app manager can send message"))
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|