I see no issue in putting the permission check into it's own function.
checkServer() is more than 100 lines long - making it smaller is a good idea anyhow