sprint6+7: permission notifications + audit trail + notification entity filter + mail account permissions + migration 0053
Check Cross-Plugin Imports / check (push) Has been cancelled

This commit is contained in:
Agent Zero
2026-07-29 02:18:17 +02:00
parent 71ed592aa2
commit 88c04286af
7 changed files with 240 additions and 64 deletions
+41
View File
@@ -0,0 +1,41 @@
"""Add owner_id to mail_accounts for row-level permissions.
Revision ID: 0053
Revises: 0052
Create Date: 2026-07-29
This migration adds owner_id to mail_accounts so that the universal
visibility/permission system (apply_visibility_filter, check_single_entity_access)
can be used for mail accounts.
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects.postgresql import UUID
revision = "0053"
down_revision = "0052"
branch_labels = None
depends_on = None
def upgrade():
op.add_column(
"mail_accounts",
sa.Column(
"owner_id",
UUID(as_uuid=True),
sa.ForeignKey("users.id", ondelete="SET NULL"),
nullable=True,
),
)
op.create_index(
"ix_mail_accounts_owner",
"mail_accounts",
["owner_id"],
)
def downgrade():
op.drop_index("ix_mail_accounts_owner", table_name="mail_accounts")
op.drop_column("mail_accounts", "owner_id")