export const ROLES = Object.freeze({
	BRANCH: "branch",
	ADMIN: "admin",
	SUPERADMIN: "superadmin",
	DEV: "dev",
});

/**
 * Returns true for roles that are "admin-like" in the UI:
 * - admin, superadmin, dev
 *
 * @param {unknown} role
 * @returns {boolean}
 */
export function isAdminLike(role) {
	return (
		role === ROLES.ADMIN || role === ROLES.SUPERADMIN || role === ROLES.DEV
	);
}

/**
 * Returns true for roles that can manage users (RHL-012 capability):
 * - superadmin, dev
 *
 * @param {unknown} role
 * @returns {boolean}
 */
export function canManageUsers(role) {
	return role === ROLES.SUPERADMIN || role === ROLES.DEV;
}
