From 5f3e9886f713e9712abf8c1ac5b762ed6f89de3d Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Sun, 10 Oct 2021 01:00:32 +0200 Subject: [PATCH] HackStudio: Disable the Rename action on insufficient permissions This patch will disable the Rename action in the project Tree View if a user does not have write access to the selected file directory. --- Userland/DevTools/HackStudio/HackStudioWidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/DevTools/HackStudio/HackStudioWidget.cpp b/Userland/DevTools/HackStudio/HackStudioWidget.cpp index 52edaa2881..92f840799f 100644 --- a/Userland/DevTools/HackStudio/HackStudioWidget.cpp +++ b/Userland/DevTools/HackStudio/HackStudioWidget.cpp @@ -983,6 +983,7 @@ void HackStudioWidget::configure_project_tree_view() return access(m_project->model().full_path(selected_file.parent()).characters(), W_OK) == 0; }); bool has_permissions = it != selections.end(); + m_tree_view_rename_action->set_enabled(has_permissions); m_delete_action->set_enabled(has_permissions); };