⭐️⭐️⭐️ Open-source, self-hosted alternative to Linear and Plane. Project management and issue tracking where teams and AI agents work side by side to plan and ship products.
TypeScript agenticagileai-agentsbug-reportingbug-trackerganttissue-trackerjirajira-alternativekanbanlinearlinear-alternativeopen-sourceproduct-managementproject-managementroadmapself-hostedsprint-planningteam-collaborationtrello-alternative
import type { InviteRow } from '@/lib/api/endpoints/invites';
export const isInviteExpired = (invite: Pick<InviteRow, 'expiresAt'>) =>
invite.expiresAt != null && new Date(invite.expiresAt) < new Date();
// A renewal hands the grant out again, so the API (mayGrantInviteRanks) allows it only to
// whoever could have sent it: a team rank is the team owner's to give, and a project's
// ownership is for whoever runs the team or owns that project.
export function mayRenewInvite(
invite: Pick<InviteRow, 'teamRole' | 'role'>,
viewer: { teamRole: string | null; ownsProject: boolean },
): boolean {
const runsTeam = viewer.teamRole === 'owner' || viewer.teamRole === 'manager';
if (invite.teamRole !== 'member' && viewer.teamRole !== 'owner') return false;
if (invite.role === 'owner' && !runsTeam && !viewer.ownsProject) return false;
return true;
}