Forums / Developer / Grant access for anonymouse users on search module on an folder which is hidden from anonymouse users

Grant access for anonymouse users on search module on an folder which is hidden from anonymouse users

Author Message

Romeo Antony

Friday 23 July 2010 1:12:04 am

Hi, I am the first time working with user roles and policies(new ).I have read through the documenation in ez.

I will explain what I am trying to do on user policies.

In webiste I have 5 topmenues , these top menus are created by class frontpage.

Also all the contents in these 5 tope menus are referred from a folder called archival .

This archival folder is hidden from the anonymouse users.

For that I have set a section for this archival folder and this section is not accessible by anonymous users. All the other topmunes are in the standard section so anonymous users can read the contents.

but, I want to grant access to anonymouse users to search on contents present in the archival folder . But it is not happening, since I have set anonymouse users can access only standard section.

Also for search module, function limitation is not available.Anyone have any idea please guide me. Romeo .

Philippe VINCENT-ROYOL

Friday 23 July 2010 3:07:42 am

Hi Romeo,

If you use ezfind to search, use "limitation" parameters to override current user access

http://ez.no/doc/extensions/ez_find/2_2/customization/template_fetch_functions

else

http://ez.no/doc/ez_publish/technical_manual/4_x/reference/modules/content/fetch_functions/search

Have fun :)

Certified Developer (4.1): http://auth.ez.no/certification/verify/272607
Certified Developer (4.4): http://auth.ez.no/certification/verify/377321

G+ : http://plus.tl/dspe
Twitter : http://twitter.com/dspe

Romeo Antony

Friday 23 July 2010 3:59:24 am

Philippe, thank you for your reply. But can you please tell me can I do something with roles and policies in admin interface to search contents of a hidden node. Please give me a suggestion. ROmeo

Romeo Antony

Friday 23 July 2010 4:37:57 am

In my search.tpl I have set it like

{let search=false()}
{section show=$use_template_search}
{set page_limit=10}
{set search=fetch(content,search,
hash(text,$search_text,
section_id,$search_section_id,
subtree_array,$search_subtree_array,
sort_by,array('modified',false()),
offset,$view_parameters.offset,
ignore_visibility,true(),
limit,$page_limit))}
{set search_result=$search['SearchResult']}
{set search_count=$search['SearchCount']}
{set stop_word_array=$search['StopWordArray']}
{set search_data=$search}
{/section}

But it is not showing the hidden nodes after searching. Can anyone please help me.

Peter Keung

Friday 23 July 2010 8:02:16 am

Do not confuse node visibility with sections and their related permissions. If you set the "limitation" parameter to be an empty array, the result list should bypass permissions:

http://ez.no/doc/ez_publish/technical_manual/4_x/reference/modules/content/fetch_functions/search

Also, note that by default the template search code won't be executed (the PHP view code would be executed) unless you remove the $use_template_search condition in site.ini:

http://ez.no/doc/ez_publish/technical_manual/4_x/reference/configuration_files/site_ini/searchsettings/searchviewhandling

http://www.mugo.ca
Mugo Web, eZ Partner in Vancouver, Canada