dev login logic and role hierarchy