Check if user is authenticated before checking is_staff flag