shellphone.app/types.ts

22 lines
499 B
TypeScript
Raw Normal View History

import { DefaultCtx, SessionContext, SimpleRolesIsAuthorized } from "blitz";
2021-07-31 14:33:18 +00:00
2021-08-05 17:07:15 +00:00
import { Organization, User, GlobalRole, MembershipRole } from "./db";
type Role = GlobalRole | MembershipRole;
2021-07-31 14:33:18 +00:00
declare module "blitz" {
export interface Ctx extends DefaultCtx {
session: SessionContext;
2021-07-31 14:33:18 +00:00
}
export interface Session {
isAuthorized: SimpleRolesIsAuthorized<Role>;
2021-07-31 14:33:18 +00:00
PublicData: {
userId: User["id"];
2021-08-05 17:07:15 +00:00
roles: Role[];
orgId: Organization["id"];
2021-10-15 22:24:28 +00:00
shouldShowWelcomeMessage?: true;
};
2021-07-31 14:33:18 +00:00
}
}