Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: wang yan <wangyan@vmware.com>
  • Loading branch information
wy65701436 committed Sep 24, 2024
1 parent eaa72b4 commit 6505c23
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/server/v2.0/handler/robot.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,20 +451,20 @@ func (rAPI *robotAPI) updateV2Robot(ctx context.Context, params operation.Update
if scRobots[0].ID != creatorRobot.ID && scRobots[0].ID != r.ID {
return errors.New(nil).WithMessage("as for a nested robot account, only person who has the right permission or the creator robot or nested robot itself has the permission to update").WithCode(errors.DENIED)
}
fmt.Println("=================")
fmt.Println(scRobots[0])
fmt.Println(creatorRobot)
fmt.Println("=================")
}

fmt.Println("2=================")
fmt.Println("2=================")

if !validPermissionScope(params.Robot.Permissions, creatorRobot.Permissions) {
return errors.New(nil).WithMessage("the permission scope is valid, it's must be less and equals the the creator robot").WithCode(errors.DENIED)
}
}

sc, err := rAPI.GetSecurityContext(ctx)
if err != nil {
return err
}
if _, ok := sc.(*robotSc.SecurityContext); ok {

}

if err := rAPI.robotCtl.Update(ctx, r, &robot.Option{
WithPermission: true,
}); err != nil {
Expand Down

0 comments on commit 6505c23

Please sign in to comment.