mirror of
https://github.com/idrainformatica/PecFlow.git
synced 2026-06-16 20:55:41 +02:00
55 lines
1.2 KiB
Python
55 lines
1.2 KiB
Python
"""
|
|
Schema Pydantic per permessi granulari casella (Fase 1-A).
|
|
"""
|
|
|
|
import uuid
|
|
from datetime import datetime
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class PermissionGrantRequest(BaseModel):
|
|
can_read: bool = True
|
|
can_send: bool = False
|
|
can_manage: bool = False
|
|
can_conserve: bool = False
|
|
|
|
|
|
class PermissionResponse(BaseModel):
|
|
id: uuid.UUID
|
|
tenant_id: uuid.UUID
|
|
user_id: uuid.UUID
|
|
mailbox_id: uuid.UUID
|
|
can_read: bool
|
|
can_send: bool
|
|
can_manage: bool
|
|
can_conserve: bool
|
|
granted_by: uuid.UUID | None
|
|
granted_at: datetime
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class UserMailboxPermissionResponse(BaseModel):
|
|
"""Vista utente: caselle accessibili con relativi permessi."""
|
|
mailbox_id: uuid.UUID
|
|
mailbox_email: str
|
|
mailbox_display_name: str | None
|
|
can_read: bool
|
|
can_send: bool
|
|
can_manage: bool
|
|
can_conserve: bool
|
|
|
|
|
|
class MailboxUserPermissionResponse(BaseModel):
|
|
"""Vista casella: utenti con accesso."""
|
|
user_id: uuid.UUID
|
|
user_email: str
|
|
user_full_name: str
|
|
user_role: str
|
|
can_read: bool
|
|
can_send: bool
|
|
can_manage: bool
|
|
can_conserve: bool
|
|
granted_at: datetime
|