Hi,

Have been trying to get current search blocks going, but couldn't access admin page. Administer search is not available on permissions page, so finally got it going by manually adding permission in database.

Facet API is working as it should, running on 'administer facets' permission (function facetapi_access_callbak()).

Any ideas of why this happened?

Comments

cpliakas’s picture

Yes, because of the way CTools export plugin UI works, you have to hard code one permission. I chose "administer search", but that is not available when you are not using the core Search module. We can either implement a hook_menu_alter() to use the same permissions scheme as facets, or we can implement a new permission for administering the current search blocks. I am leaning towards leveraging the facetapi_access_callback() since most current search blocks have facet data, but I would be curious to get your take.

Thanks for reporting,
Chris

Zahak’s picture

Ah I see, was suspecting something like that. I think that facetapi_access_callback() makes sense. Don't really see a need for a new permission.

cpliakas’s picture

Status: Active » Needs review
StatusFileSize
new1 KB

The attached patch changes the access callback for the Current Search administration pages to facetapi_access_callback() as discussed.

Thanks,
Chris

cpliakas’s picture

StatusFileSize
new1.01 KB

Same patch, changed text in comments.

cpliakas’s picture

Status: Needs review » Needs work

Hm, I switched the logic. The pattern will match admin/config/search/current_search_foo, which is not the intended behavior. It should match admin/config/search/current_search, but not admin/config/search/current_search_foo.

cpliakas’s picture

Status: Needs work » Needs review
StatusFileSize
new1.01 KB

Resolved logic error.

Zahak’s picture

Great, looks good!

cpliakas’s picture

Status: Needs review » Reviewed & tested by the community

Based on #7 and this being a somewhat minor change, marking as RTBC.

cpliakas’s picture

Status: Reviewed & tested by the community » Fixed

Committed to all 7.x versions of Facet API.

Backported to 6.x-3.x version of Facet API.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.