fix inncorrect query in getExternalService and show corresponding permissions