From 90ab06ce9c37c3774c17936debd7ab059fa1b8b4 Mon Sep 17 00:00:00 2001 From: Northseadl <99570485+northseadl@users.noreply.github.com> Date: Tue, 26 Sep 2023 11:13:18 +0800 Subject: [PATCH] temp fix: casbin re-migrate error --- internal/uc/powerx/authorizationadmin.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/uc/powerx/authorizationadmin.go b/internal/uc/powerx/authorizationadmin.go index 05ed8759..95d6ccac 100644 --- a/internal/uc/powerx/authorizationadmin.go +++ b/internal/uc/powerx/authorizationadmin.go @@ -173,16 +173,16 @@ func (uc *AdminPermsUseCase) Init() { } } - // 初始化casbin策略 - if err := uc.db.Model(&permission.EmployeeCasbinPolicy{}).Count(&count).Error; err != nil { - panic(errors.Wrap(err, "init casbin policy failed")) - } - if count == 0 { - uc.Casbin.SetAdapter(uc.fileAdapter) - uc.Casbin.LoadPolicy() - uc.Casbin.SetAdapter(uc.sqlAdapter) - uc.Casbin.SavePolicy() - } + //// 初始化casbin策略 + //if err := uc.db.Model(&permission.EmployeeCasbinPolicy{}).Count(&count).Error; err != nil { + // panic(errors.Wrap(err, "init casbin policy failed")) + //} + //if count == 0 { + // uc.Casbin.SetAdapter(uc.fileAdapter) + // uc.Casbin.LoadPolicy() + // uc.Casbin.SetAdapter(uc.sqlAdapter) + // uc.Casbin.SavePolicy() + //} // 初始化角色 if err := uc.db.Model(&permission.AdminRole{}).Count(&count).Error; err != nil {