RBAC in the API

This commit is contained in:
James Pattinson
2025-10-23 20:02:54 +00:00
parent 91b734426c
commit fb21329109
7 changed files with 131 additions and 21 deletions

View File

@@ -13,6 +13,12 @@ class PPRStatus(str, Enum):
DEPARTED = "DEPARTED"
class UserRole(str, Enum):
ADMINISTRATOR = "administrator"
OPERATOR = "operator"
READ_ONLY = "read_only"
class PPRRecord(Base):
__tablename__ = "submitted"
@@ -44,6 +50,7 @@ class User(Base):
id = Column(Integer, primary_key=True, autoincrement=True)
username = Column(String(50), nullable=False, unique=True, index=True)
password = Column(String(255), nullable=False)
role = Column(SQLEnum(UserRole), nullable=False, default=UserRole.READ_ONLY)
class Journal(Base):