1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:07:43 +00:00

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.
This commit is contained in:
Karol Kosek 2021-10-10 01:00:32 +02:00 committed by Andreas Kling
parent 0264d3de45
commit 5f3e9886f7

View file

@ -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);
};