we recently decided to refactor coding which uses hardcoded Ids and Names for permission checks on profiles. We want to use custom permissions, which then can be added to permission sets and therefore make it easier to fine tune the permission scheme. And it's pretty easy to use in Visualforce and APEX as well.
I am aware, that there are ways to get some system information like:
var userInfo = sforce.connection.getUserInfo();
Is there a similar thing to get the custom permissions?