fix(widget): 完善自动回复与新会话进线提醒
This commit is contained in:
@@ -27,10 +27,6 @@ func (h *SettingsHandler) Get(c *gin.Context) {
|
||||
}
|
||||
|
||||
func (h *SettingsHandler) Update(c *gin.Context) {
|
||||
if !middleware.HasPermission(c, "settings.basic") {
|
||||
c.JSON(http.StatusForbidden, gin.H{"code": 403, "message": "仅租户管理员可修改设置"})
|
||||
return
|
||||
}
|
||||
tenantID := middleware.GetTenantID(c)
|
||||
if tenantID == 0 {
|
||||
c.JSON(http.StatusForbidden, gin.H{"code": 403, "message": "仅租户账号可修改设置"})
|
||||
@@ -47,6 +43,10 @@ func (h *SettingsHandler) Update(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
// 设置权限按字段分区校验,避免仅拥有基本设置权限即可修改分配、工作时间或通知策略。
|
||||
if req.TouchesBasic() && !middleware.HasPermission(c, "settings.basic") {
|
||||
c.JSON(http.StatusForbidden, gin.H{"code": 403, "message": "无权修改基本设置"})
|
||||
return
|
||||
}
|
||||
if req.TouchesAssignRule() && !middleware.HasPermission(c, "settings.assign_rule") {
|
||||
c.JSON(http.StatusForbidden, gin.H{"code": 403, "message": "无权修改客服分配规则"})
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user