Skip to content

Disable / hide MR edit blob button if cannot edit.

Created by: cirosantilli

UI changes on the merge request diff view:

  • if the user does not have permission to edit the blob, disable the link
  • if the blob is not text, hide the link

This is the same behavior as for the blob show edit button. Both buttons have been factored out.

The blob show edit button is unchanged.

Before this, there would be a clickable link to a 404 or to edit binary files as text on the page.

Screenshot of disabled Edit link:

screenshot from 2014-09-28 11 00 53 disable edit mr after

This solves half of: https://github.com/gitlabhq/gitlabhq/issues/7310

Merge request reports