modified the permission lookup functions to use the GenQuery interface