No JSDoc comment in source yet.
API
@Component({ key: "@prismshadow/penguin-server#ProjectAccess" })
export class ProjectAccess implements Access {
@Use() private readonly projects!: Projects;
@Use() private readonly members!: Members;
@Use() private readonly projectConfig!: ProjectConfigStore;
find(userId: string, projectId: string): (ProjectRow & { role: ProjectRole }) | null;
requireProjectAccess(userId: string, projectId: string): ProjectRow & { role: ProjectRole };
canAccess(userId: string, projectId: string): boolean;
requireProjectOwner(userId: string, projectId: string): ProjectRow;
accessibleProjectIds(userId: string): string[];
async listProjects(userId: string): Promise<ProjectSummary[]>;
}Dependencies & Wiring
Extracted from class decoratorsMethods (6)
find
find(userId: string, projectId: string): (ProjectRow & { role: ProjectRole }) | nullThe sole implementation of the owner / member check: the row with a role when accessible, otherwise null. Every other member here is a wrapper around it.
@paramuserId
string@paramprojectId
string@returns
(ProjectRow & { role: ProjectRole }) | nullrequireProjectAccess
requireProjectAccess(userId: string, projectId: string): ProjectRow & { role: ProjectRole }Accessible by owner or member; otherwise 404 (does not leak Project existence).
@paramuserId
string@paramprojectId
string@returns
ProjectRow & { role: ProjectRole }canAccess
canAccess(userId: string, projectId: string): booleanThe non-throwing form, for error attribution — where another 404 would only break error handling.
@paramuserId
string@paramprojectId
string@returns
booleanrequireProjectOwner
requireProjectOwner(userId: string, projectId: string): ProjectRowOwner only: 403 when known accessible as a member; 404 when not accessible.
@paramuserId
string@paramprojectId
string@returns
ProjectRowaccessibleProjectIds
accessibleProjectIds(userId: string): string[]Every project_id the user may reach (owned + granted).
@paramuserId
string@returns
string[]listProjects
async listProjects(userId: string): Promise<ProjectSummary[]>Owned + granted Projects with their display names.
@paramuserId
string@returns
Promise<ProjectSummary[]>