This commit is contained in:
Timothy Jaeryang Baek
2024-11-14 20:13:43 -08:00
parent 150d0adea2
commit dff85c733d
6 changed files with 64 additions and 23 deletions

View File

@@ -68,10 +68,21 @@ class Model(Base):
"""
access_control = Column(JSON, nullable=True) # Controls data access levels.
# NULL for public access (open to all users with "user" role).
# {} for individual access (private to the owner).
# {"group_ids": ["group_id1", "group_id2"]} for access restricted to specific groups.
# {"user_ids": ["user_id1", "user_id2"]} for access restricted to specific users.
# Defines access control rules for this entry.
# - `None`: Public access, available to all users with the "user" role.
# - `{}`: Private access, restricted exclusively to the owner.
# - Custom permissions: Specific access control for reading and writing;
# Can specify group or user-level restrictions:
# {
# "read": {
# "group_ids": ["group_id1", "group_id2"],
# "user_ids": ["user_id1", "user_id2"]
# },
# "write": {
# "group_ids": ["group_id1", "group_id2"],
# "user_ids": ["user_id1", "user_id2"]
# }
# }
updated_at = Column(BigInteger)
created_at = Column(BigInteger)
@@ -86,7 +97,7 @@ class ModelModel(BaseModel):
params: ModelParams
meta: ModelMeta
access_control = Optional[dict] = None
access_control: Optional[dict] = None
updated_at: int # timestamp in epoch
created_at: int # timestamp in epoch