mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-12-05 19:27:57 -05:00
Reduce script permissions to a single "run unrestricted" switch
Python scripts always run and follow the plugin permission checks; the switch in Preferences lets them bypass the checks. Plugins call the tools and offer operations without a separate permission.
This commit is contained in:
1 parent
869d8a9b96
commit
636367d143
40 files changed
+288
-480
No files matched your search
@@ -27,6 +27,12 @@ bool PythonRunScope::owns_ui() const { return is_script_identity(m_identity); }
|
||||
|
||||
std::string PythonRunScope::ui_owner() const { return owns_ui() ? "script/" + std::to_string(m_id) : m_identity; }
|
||||
|
||||
void PythonRunScope::allow_folder_reads() const
|
||||
{
|
||||
if (is_script_identity(m_identity) && !m_file.empty())
|
||||
PluginAuditManager::instance().add_scoped_allowed_root(m_file.parent_path(), /*allow_write=*/false);
|
||||
}
|
||||
|
||||
nlohmann::json PythonRunScope::call_tool(const std::string& tool, const nlohmann::json& args)
|
||||
{
|
||||
ToolBridge* bridge = nullptr;
|
||||
|
||||
Reference in new issue
Block a user