mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-09-19 17:50:12 +00:00
fix(controller): enforce ownership on notification group, NAT server, and batch move
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
This commit is contained in:
@@ -194,8 +194,6 @@ func validateRule(c *gin.Context, r *model.AlertRule) error {
|
||||
return singleton.Localizer.ErrorT("need to configure at least a single rule")
|
||||
}
|
||||
|
||||
// Trigger task IDs are user-controlled; validate them here so alerts cannot
|
||||
// reference another user's cron and later execute it from the sentinel path.
|
||||
if !singleton.CronShared.CheckPermission(c, slices.Values(r.FailTriggerTasks)) {
|
||||
return singleton.Localizer.ErrorT("permission denied")
|
||||
}
|
||||
@@ -203,5 +201,9 @@ func validateRule(c *gin.Context, r *model.AlertRule) error {
|
||||
return singleton.Localizer.ErrorT("permission denied")
|
||||
}
|
||||
|
||||
if err := assertOwnsNotificationGroup(c, r.NotificationGroupID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user