Use owner for git actions during designs copy
requested to merge 263102-bugfix-use-project-owner-to-perform-git-actions-during-design-copy into master
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.
- Issue: #263102 (closed)
Notes
- 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 inGitAccessDesign
which is where the error in #263102 (closed) was coming from. - The preferred maintainer is
@stanhu
due to their previous familiarity with the feature !41714 (merged).
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
- [-] Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
- [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Edited by Luke Duncalfe