First rough implementation of permission-based search