implementing login and basic permissions