- Added new API endpoints for listing and updating widget-feature assignments, allowing for custom feature requirements. - Introduced a new admin page for managing widget-feature assignments, enhancing the admin interface. - Updated navigation to include a link to the new widget-feature assignments page. - Refactored widget access logic to support AND-based feature requirements for widgets. - Bumped app_dashboard version to 1.11.0 to reflect these changes and improvements.
17 lines
867 B
SQL
17 lines
867 B
SQL
-- Dashboard-Widgets: explizite Feature-Anforderungen (Custom) statt nur widget_catalog.requires_feature
|
|
-- Kein Eintrag in dashboard_widget_requirement_custom → Anforderungen aus Code (Katalog).
|
|
-- Eintrag vorhanden → AND über alle zugeordneten features (0 Zeilen = kein Feature nötig).
|
|
|
|
CREATE TABLE IF NOT EXISTS dashboard_widget_requirement_custom (
|
|
widget_id VARCHAR(64) PRIMARY KEY,
|
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS widget_feature_requirements (
|
|
widget_id VARCHAR(64) NOT NULL REFERENCES dashboard_widget_requirement_custom (widget_id) ON DELETE CASCADE,
|
|
feature_id TEXT NOT NULL REFERENCES features (id) ON DELETE CASCADE,
|
|
PRIMARY KEY (widget_id, feature_id)
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_widget_feature_requirements_feature_id ON widget_feature_requirements (feature_id);
|