From 36c87e17b7489cf945e4c68db4c0270d42b992de Mon Sep 17 00:00:00 2001 From: Jian Qiu Date: Sun, 13 Apr 2025 09:56:09 +0800 Subject: [PATCH] fix: notify default policy not effective (#22379) Co-authored-by: Qiu Jian --- pkg/cloudcommon/policy/defaults.go | 3 +++ pkg/notify/models/subscriber.go | 12 ------------ pkg/notify/service/handlers.go | 1 - 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/pkg/cloudcommon/policy/defaults.go b/pkg/cloudcommon/policy/defaults.go index f3129b1330..2d5d1b0006 100644 --- a/pkg/cloudcommon/policy/defaults.go +++ b/pkg/cloudcommon/policy/defaults.go @@ -15,6 +15,8 @@ package policy import ( + "yunion.io/x/jsonutils" + "yunion.io/x/log" "yunion.io/x/pkg/util/rbacscope" "yunion.io/x/onecloud/pkg/util/rbacutils" @@ -72,5 +74,6 @@ var ( ) func AppendDefaultPolicies(policies []rbacutils.SRbacPolicy) { + log.Infof("Appending default policies: %s", jsonutils.Marshal(policies)) predefinedDefaultPolicies = append(predefinedDefaultPolicies, policies...) } diff --git a/pkg/notify/models/subscriber.go b/pkg/notify/models/subscriber.go index 50c1a2940c..e3c29dde0f 100644 --- a/pkg/notify/models/subscriber.go +++ b/pkg/notify/models/subscriber.go @@ -12,18 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - package models import ( diff --git a/pkg/notify/service/handlers.go b/pkg/notify/service/handlers.go index 38ed263ebd..1e66c8538a 100644 --- a/pkg/notify/service/handlers.go +++ b/pkg/notify/service/handlers.go @@ -39,7 +39,6 @@ func InitHandlers(app *appsrv.Application) { db.AddScopeResourceCountHandler(API_VERSION, app) - taskman.AddTaskHandler(API_VERSION, app) for _, manager := range []db.IModelManager{ taskman.TaskManager, taskman.SubTaskManager,