It is possible to disable search not members?

I would like to disable the search for non members currently not members can use the search engine in the public contents.

I do not want to leave the search enabled members not only to members.

The members should not have access to the public contents only by the full link.

Hiding the search through CSS is the most simple solution. There is

body.userrole-anonymous

Otherwise you need to reconfigure the permissions of the related browser views - /search in particular.

-aj

If you use a diazo theme, you could make it even a bit harder (for anon to search), with something like:

<rules css:if-content=".userrole-anonymous">
 <drop css:content="#portal-searchbox" />  
 <drop css_content="#searchform" />
</rules>

That said: it is still possible to search by 'handcrafting an url etc)

@zopyx and @espenmn
I tried to add in file rules.xml:

  <rules css:if-content="body.userrole-anonymous">
    <drop css:theme="#anonymous-actions" />  
    <drop ss:content-children="#portal-searchbox" /> 
    <drop css:content="#searchGadget_form" />
  </rules>

But it did not work, I tried what you gave an example:

<rules css:if-content=".userrole-anonymous">
 <drop css:content="#portal-searchbox" />  
 <drop css_content="#searchform" />
</rules>

But also it did not work.

I am using the theme "Barceloneta". Any idea why not work?

did you disable and enable the theme?

@espenmn
After disable and enable work properly.
Thank you!