| 123456789101112131415 |
- from sqlalchemy import String, Text
- from sqlalchemy.dialects.sqlite import JSON
- from sqlalchemy.orm import Mapped, mapped_column
- from core_db import AuditMixin, Base, TenantMixin, VersionMixin
- class Role(Base, TenantMixin, AuditMixin, VersionMixin):
- __tablename__ = "auth_role"
- code: Mapped[str] = mapped_column(String(128), index=True)
- name: Mapped[str] = mapped_column(String(128))
- description: Mapped[str | None] = mapped_column(Text, nullable=True)
- status: Mapped[str] = mapped_column(String(32), default="active", index=True)
- permissions_json: Mapped[list[str]] = mapped_column(JSON, default=list)
|