Skip to content

Prevent renaming a locked file

Michelle Gill requested to merge 38230-locked-files into master

What does this MR do?

Closes: #38230 (closed)

Currently, if User A locks a file, User B is able to rename the file, which would essentially be removing it from the repo and adding a new file back that is unlocked. This merge request prevents users from renaming locked files unless they have permission to do so.

There were not many tests related to the various locked file scenarios, so I have additionally added tests for modifying, renaming, and removing files based on user permission.

Screenshots

Screen_Shot_2020-03-19_at_1.55.54_PM

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Closes #38230 (closed)

Edited by Michelle Gill

Merge request reports