Fix search and adding permission in the backend