mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-20 10:28:36 +02:00
Do not show editor for locked lfs file by other user
This commit is contained in:
parent
5dc082a2ad
commit
349d5b1597
@ -162,6 +162,18 @@ func editFile(ctx *context.Context, isNewFile bool) {
|
||||
|
||||
defer dataRc.Close()
|
||||
|
||||
if fInfo.isLFSFile {
|
||||
lfsLock, err := git_model.GetTreePathLock(ctx, ctx.Repo.Repository.ID, ctx.Repo.TreePath)
|
||||
if err != nil {
|
||||
ctx.ServerError("GetTreePathLock", err)
|
||||
return
|
||||
}
|
||||
if lfsLock != nil && lfsLock.OwnerID != ctx.Doer.ID {
|
||||
ctx.NotFound(nil)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
ctx.Data["FileSize"] = blob.Size()
|
||||
|
||||
// Only some file types are editable online as text.
|
||||
|
Loading…
x
Reference in New Issue
Block a user