Skip to content

Fix cross referencing for private and internal projects

Jarka Košanová requested to merge 31978-cross-reference-fix into master

What does this MR do?

It fixes cross referencing objects that are not publicly visible.

It sets current_user correctly whenever extractor is used in all_references (Mentionable concern)

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

In https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7926/diffs#056b58f8b11b5ed98472bf7ee291814409cbde33_49_51 we started using memorised extractor. However when called for the first time from NewNoteWorker the current_user is nil - that is correct.

However when it is called for the second time - when trying to create cross references - it should be set to note.author. But we use already initialised extractor with nil as current_user.

There is a permission check as the next step. But for current_user = nil all objects that are not public are evaluated as not accessible to the user.

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #31978 (closed)

Merge request reports