feat: implement user type-based UI access control

Restrict settings interface and material validation features based on user type:

- SettingsTab: User type only sees "Test ERP Connection" and "Test Database Connection" buttons; Admin sees full configuration interface
- MaterialValidationTab: Hide manager filter and data source options from non-admin users; default to database_filtered mode
- test_db_connection(): Read from config directly to support User type without UI variables
- Add backward compatibility: no session_manager defaults to full interface

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-02-10 17:30:26 +08:00
parent db461e39f9
commit d18bedcd77
4 changed files with 219 additions and 79 deletions

View File

@@ -83,8 +83,8 @@ class MainWindow:
self.query_tab = DataQueryTab(self.notebook, self.config)
self.notebook.add(self.query_tab, text="数据查询")
# 设置标签页
self.settings_tab = SettingsTab(self.notebook, self.config)
# 设置标签页(传入 session_manager
self.settings_tab = SettingsTab(self.notebook, self.config, self.session_manager)
self.notebook.add(self.settings_tab, text="设置")
def create_status_bar(self):