added simple support for custom permission checks

WIP