Updated permissions checking

In 2.6 roles and permissions use more of a key/value system, so the code has been changed to reflect that.