Enhanced permission system to work with Squeel queries