From 393c854f7bf2ae91262f8ce111c26c4e08451e17 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 16 Jan 2026 12:25:24 -0800 Subject: [PATCH] Hide delete directory button for mirror or archive repository and disable the menu item if user have no permission (#36384) --- templates/repo/view_content.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/view_content.tmpl b/templates/repo/view_content.tmpl index 5d9b3a94b4..8514566b3f 100644 --- a/templates/repo/view_content.tmpl +++ b/templates/repo/view_content.tmpl @@ -105,7 +105,7 @@ {{svg "octicon-file-zip"}}{{ctx.Locale.Tr "repo.download_directory_as" "ZIP"}} {{svg "octicon-file-zip"}}{{ctx.Locale.Tr "repo.download_directory_as" "TAR.GZ"}} {{end}} - {{if and (.Permission.CanWrite ctx.Consts.RepoUnitTypeCode) (not .Repository.IsArchived) (not $isTreePathRoot)}} + {{if and (.Repository.CanContentChange) (not $isTreePathRoot)}}
{{svg "octicon-trash" 16}}{{ctx.Locale.Tr "repo.editor.delete_this_directory"}}