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 {