PhoenixKitProjects. Schemas. ProjectSubjectGrant
(PhoenixKitProjects v0.21.0)
Copy Markdown
View Source
A project role held by a GROUP rather than a person: a staff team, a staff department, or a site role.
Direct people stay in PhoenixKitProjects.Schemas.ProjectMember — that
table keeps its real foreign key to phoenix_kit_users, the last-owner
guard, and ownership succession. This one answers the other half: "the
Design team can work here", "contractors may look".
subject_uuid carries no foreign key on purpose. It points into three
different tables, two of which (staff teams and departments) live in a
sibling package that may not be installed at all. Integrity is the
context's job: PhoenixKitProjects.Grants resolves a subject before
writing, and skips grants whose subject has since vanished when reading.
owner is not an assignable role here — ownership needs an accountable
person, and a team-owned project would break the last-owner guard the
moment the team emptied. The database rejects it too.