Implemented isAuthenticated and isValidUser policies