qudoco-fe/constants/user-roles.ts

17 lines
459 B
TypeScript
Raw Normal View History

/** Matches cookie `urie` / profile `userRoleId`. */
export const USER_ROLE_ADMIN = "1";
export const USER_ROLE_APPROVER = "2";
export const USER_ROLE_CONTRIBUTOR = "3";
export function isApproverOrAdmin(
roleId: string | undefined | null,
): boolean {
return roleId === USER_ROLE_ADMIN || roleId === USER_ROLE_APPROVER;
}
export function isContributorRole(
roleId: string | undefined | null,
): boolean {
return roleId === USER_ROLE_CONTRIBUTOR;
}