Fixed possible issue with group permissions on search, closes #794