Skip to content

Commit

Permalink
Merge pull request #511 from linthan/fixmodel
Browse files Browse the repository at this point in the history
fix: model config
  • Loading branch information
sysulq committed Apr 23, 2023
2 parents b005a03 + d2f7d36 commit 9a4d7b8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/pkg/service/appDep/app_dep.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (
Url_Gitlab = "/api/v4/projects/%d/repository/files/%s?ref=%s"
)

//DepApp ..
// DepApp ..
type DepApp interface {
ParseDepFile(app db.AppInfo) ([]*db.AppPackage, error) // 获取依赖文件内容并解析
SaveToMysql(aid int, records []*db.AppPackage) error // 解析结果存储到mysql
Expand Down Expand Up @@ -63,7 +63,7 @@ func (p *appDep) SyncAppVersion() error {

appPackages, err := depApp.ParseDepFile(app)
if err != nil {
xlog.Error("ParseDepFile", zap.Error(err), zap.String("appName", app.AppName))
xlog.Warn("ParseDepFile", zap.Error(err), zap.String("appName", app.AppName))
} else {
xlog.Info("ParseDepFile success", zap.String("appName", app.AppName))
}
Expand Down
1 change: 0 additions & 1 deletion internal/pkg/service/casbin/casbin.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ func (c *CasbinService) CheckPermission(sub, object, action string, policyType d
if !c.enabled {
return true, nil
}

ok, err = c.Enforce(sub, object, action, string(policyType))
if err != nil {
log.Errorf("CasbinService.CheckUserPermission: %s", err.Error())
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/service/casbin/model.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ g3 = _, _ # app group
e = some(where (p.eft == allow))

[matchers]
m = g(r.sub, "group_user:admin") || g(r.sub, "group_user:default") || \
m = g(r.sub, "group_user:admin") || \
( g(r.sub, p.sub) && r.type == p.type && r.act == p.act \
&& (\
(r.type == "menu" && g2(r.obj, p.obj)) \
Expand Down
1 change: 1 addition & 0 deletions internal/pkg/service/k8s/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ func (i *syncPod) mysqlCreateOrUpdate(zoneCode, domain string, in *v1.Pod) (err
}
return
}

// 数据库中不存在对应记录进行insert操作,或者历史配置被删除了,目前只有日志记录存档
err = i.db.Save(&m).Error
if err != nil {
Expand Down

0 comments on commit 9a4d7b8

Please sign in to comment.