export function hasPermission(user: { roles: Array<{slug: string}>, permissions: Array<string> }, permission: string): boolean {
    return user.roles.some( role => role.slug === "admin" ) || user.permissions.includes( permission,  0 );
}