Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: model config #511

Merged
merged 3 commits into from
Apr 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading