[User.cs] Added function to check if user is authorized.