Skip to content
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
6 changes: 5 additions & 1 deletion internal/dms/biz/cloudbeaver.go
Original file line number Diff line number Diff line change
Expand Up @@ -2060,7 +2060,11 @@ func (cu *CloudbeaverUsecase) getContextSchema(c echo.Context, connectionId, con
// checkWorkflowPermission 校验用户是否有数据源上的"创建、审批、上线工单"的权限
// 权限可以是项目级别的(项目管理员)或数据源级别的(直接针对数据源的工单权限)
func (cu *CloudbeaverUsecase) checkWorkflowPermission(ctx context.Context, userUid string, dbService *DBService) (bool, error) {
if userUid == constant.UIDOfUserAdmin {
canOpGlobal, err := cu.opPermissionVerifyUsecase.CanOpGlobal(ctx, userUid, true)
if err != nil {
return false, fmt.Errorf("check global op permission err: %v", err)
}
if canOpGlobal {
return true, nil
}
opPermissions, err := cu.opPermissionVerifyUsecase.GetUserOpPermissionInProject(ctx, userUid, dbService.ProjectUID)
Expand Down
6 changes: 5 additions & 1 deletion internal/sql_workbench/service/workflow_exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ func (sqlWorkbenchService *SqlWorkbenchService) shouldExecuteByWorkflow(dbServic
}

func (sqlWorkbenchService *SqlWorkbenchService) checkWorkflowPermission(ctx context.Context, userUID string, dbService *biz.DBService) (bool, error) {
if userUID == constant.UIDOfUserAdmin {
canOpGlobal, err := sqlWorkbenchService.opPermissionVerifyUsecase.CanOpGlobal(ctx, userUID, true)
if err != nil {
return false, fmt.Errorf("check global op permission err: %v", err)
}
if canOpGlobal {
return true, nil
}
opPermissions, err := sqlWorkbenchService.opPermissionVerifyUsecase.GetUserOpPermissionInProject(ctx, userUID, dbService.ProjectUID)
Expand Down