From cbd45471b1100bffcd2f18719b56a5da5468756b Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 11 May 2022 18:09:36 +0800 Subject: Move access and repo permission to models/perm/access (#19350) * Move access and repo permission to models/perm/access * Remove unnecessary code --- routers/api/v1/repo/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'routers/api/v1/repo/file.go') diff --git a/routers/api/v1/repo/file.go b/routers/api/v1/repo/file.go index 2a4c4ad979..1fdf70c13a 100644 --- a/routers/api/v1/repo/file.go +++ b/routers/api/v1/repo/file.go @@ -209,7 +209,7 @@ func GetEditorconfig(ctx *context.APIContext) { // canWriteFiles returns true if repository is editable and user has proper access level. func canWriteFiles(ctx *context.APIContext, branch string) bool { - return ctx.Repo.Permission.CanWriteToBranch(ctx.Doer, branch) && + return ctx.Repo.CanWriteToBranch(ctx.Doer, branch) && !ctx.Repo.Repository.IsMirror && !ctx.Repo.Repository.IsArchived } -- cgit v1.2.3