Skip to content

Commit

Permalink
refract: rename function
Browse files Browse the repository at this point in the history
Signed-off-by: lijie <lijie@pingcap.com>
  • Loading branch information
jayl1e committed Dec 13, 2023
1 parent e4529c9 commit 046682a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tibuild/pkg/rest/service/dev_build_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (s DevbuildServer) Create(ctx context.Context, req DevBuild, option DevBuil
req.Meta.CreatedAt = s.Now()
req.Status.Status = BuildStatusPending

if err := validate_permission(ctx, req); err != nil {
if err := validatePermission(ctx, req); err != nil {
return nil, fmt.Errorf("%s%w", err.Error(), ErrAuth)
}

Expand Down Expand Up @@ -81,7 +81,7 @@ func (s DevbuildServer) Create(ctx context.Context, req DevBuild, option DevBuil
return &entity, nil
}

func validate_permission(ctx context.Context, req DevBuild) error {
func validatePermission(ctx context.Context, req DevBuild) error {
if req.Spec.TargetImg != "" && ctx.Value(KeyOfUserName) != AdminUserName {
return fmt.Errorf("targetImage deny because of permission")
}
Expand Down

0 comments on commit 046682a

Please sign in to comment.