Source code for ska_oso_pdm.proposal.proposal_access

from pydantic import Field

from ska_oso_pdm._shared import Metadata, PdmObject, ProposalID
from ska_oso_pdm._shared.atoms import TerseStrEnum


[docs] class ProposalRole(TerseStrEnum): PrincipalInvestigator = "Principal Investigator" CoInvestigator = "Co-Investigator"
[docs] class ProposalPermissions(TerseStrEnum): """Permissions for a user on a proposal.""" # We need to see how this can be related to the scopes at some point. Submit = "submit" Update = "update" View = "view"
[docs] class ProposalAccess(PdmObject): metadata: Metadata = Field( default_factory=Metadata, description="The metadata of this Proposal access." ) access_id: str prsl_id: ProposalID user_id: str role: ProposalRole permissions: list[ProposalPermissions] = Field( default=[ProposalPermissions.View], description="Permissions granted to this user for this proposal.", )