You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[P1][security] read_only profile flag is UI-only — backend executes DML/DDL unrestricted (FR-1.2.7) #277
DESIGN_REQUIREMENTS §FR-1.2.7 acceptance: "Per-connection toggle to prevent any write operations (INSERT, UPDATE, DELETE, DROP, etc.); visual indicator when active".
Problem
ConnectionProfile.read_only is shown in the UI, persisted, and listed — but QueryExecutor::execute_owned routes every statement (including DROP/DELETE/TRUNCATE) straight to MySQL. No grep -n "read_only" src-tauri/crates/mas-core/src/query/ match. A user toggling Read-only mode and Ctrl+Enter-ing a destructive statement watches it run. The visual indicator half of the spec is also missing — no lock badge on the connection tab, no override-on-write confirmation.
Backend returns Err("Connection is read-only: <statement>"), frontend surfaces the error, no data lost. With read_only=false, same query runs unchanged.
Proposed fix
Scope M. In execute_owned, look up profile.read_only via the connection manager; if true and SQL contains a non-SELECT statement, return CoreError::ReadOnlyViolation. Frontend: lock badge next to connection name; confirmation dialog on non-SELECT attempt while read_only.
Acceptance
Connecting with read_only=true and executing DROP TABLE users is rejected by the backend and surfaced in the UI.
Enforcement:executor.rs refuses before the batch is assembled — if self.connection_manager.is_read_only(&connection_id) finds the first write statement via is_write_statement and returns CoreError::ReadOnly, so a script is rejected whole rather than half-run.
Indicator:ConnectionTabs.tsx renders a read-only badge on the tab, with a comment noting that the executor is what actually enforces it and the badge is the part the user can see.
Not auto-closed because the PR body wrote Refs #277.
Activity
fix(connection): stop a locked keyring from deleting the stored passw…
EVWorth commentedon Sep 7, 2026
Fixed by #526. Both halves are in place.
Enforcement: executor.rs refuses before the batch is assembled —
if self.connection_manager.is_read_only(&connection_id)finds the first write statement viais_write_statementand returnsCoreError::ReadOnly, so a script is rejected whole rather than half-run.Indicator: ConnectionTabs.tsx renders a read-only badge on the tab, with a comment noting that the executor is what actually enforces it and the badge is the part the user can see.
Not auto-closed because the PR body wrote
Refs #277.