Skip to content

Use owner for git actions during designs copy

What does this MR do?

When moving an issue we copy the design collection. Copying the design collection involves adding commits to the design repository. Some users have permission to move the issue (:admin_issue on the target project), but not permission to push to the design repository of that project and are being denied by GitAccessDesign#check_can_create_design!.

Instead, we now use the Project#default_owner to perform all of the git actions instead of the current_user.

We still record the correct Version#author of the design in PostgreSQL and still check the user can :admin_issue the target issue before performing the copy.

Notes

  1. There are no tests because the existing tests of CopyService already use a user with reporter access. I think the only reason why these unit tests pass is that Gitaly calls don't callback to our post-receive checks in GitAccessDesign which is where the error in #263102 (closed) was coming from.
  2. The preferred maintainer is @stanhu due to their previous familiarity with the feature !41714 (merged).

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Luke Duncalfe

Merge request reports