code: func (c *CodebaseController) verifyCodebaseOwner(ctx context.Context, codebaseID uuid.UUID) (*codebase.Codebase, error) {
  	currentUser, err := login.ContextIdentity(ctx)
  	if err != nil {
  		return nil, goa.ErrUnauthorized(err.Error())
  	}
  	var cb *codebase.Codebase
  	var cbSpace *space.Space
  	err = application.Transactional(c.db, func(appl application.Application) error {
  		cb, err = appl.Codebases().Load(ctx, codebaseID)
  		if err != nil {
  			return err
  		}
  		cbSpace, err = appl.Spaces().Load(ctx, cb.SpaceID)
  		return err
  	})
  	if err != nil {
  		return nil, err
  	}
  	if !uuid.Equal(*currentUser, cbSpace.OwnerID) {
  		log.Warn(ctx, map[string]interface{}{
  			"codebase_id":  codebaseID,
  			"space_id":     cbSpace.ID,
  			"space_owner":  cbSpace.OwnerID,
  			"current_user": *currentUser,
  		}, "user is not the space owner")
  		return nil, errors.NewForbiddenError("user is not the space owner")
  	}
  	return cb, nil
  }
docs: // verifyCodebaseOwner makes sure that the users making changes are the ones who own it
  // this can be called in the update and delete to verify that, if the verification is successful
  // this function also returns the codebase object corresponding to the codebase id that was passed