in determine_user_rights() changed r1 to rl (typo: 1 and l look so similar)