RBAC in the API
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user