Apologies if this is a oversight on my behalf or reported previously - I could not find anything related.
Everything works as expected when no permissions limitations are applied. When I choose only specific roles to be able to use a facet (e.g. admin/config/search/facetapi/apachesolr%40solr/block/bundle/dependencies) and the admin user (uid 1) does not have any of these roles, then the facet is not displayed for the admin user. If empty text has been defined for the facet (e.g. admin/config/search/facetapi/apachesolr%40solr/block/bundle/edit) then the facet block appears with the empty text. If the allowed facet roles are assigned to the admin user, then facets appear as expected.
Shouldn't the admin user be allowed to view the facets regardless of limitations in the facet dependencies page?
Thanks
Comments
Comment #1
nick_vhI suppose this is an issue for Facetapi?
Comment #2
cpliakas commentedHi natuk.
Thanks for posting. User 1 is a special case, and to be consistent with Drupal I think you are correct in that this user should always pass the role dependency. I am putting this on the "low hanging fruit" list as it would be an easy fix. Would love to get a patch for this since it would be great to get the 20th code contributor. Specifically, an
if (1 == $user->uid)could be wrapped around lines 18 to 21 of the FacetapiDependencyRole::execute() method which would essentially return NULL for user 1. Note that we don't want to return TRUE so we can give other dependencies the chance to either pass or fail.Based on your description, there is also another bug in the code's logic that I cross posted at #1395224: Empty facet behavior plugin is executed on facets that fail dependencies. As the title suggests, the empty facet behavior plugin shouldn't be executed for a facet that fails its dependencies.
Thanks,
Chris
Comment #3
cpliakas commentedChanging title to be more reflective of the bug.
Comment #4
cpliakas commentedNobody seemed to want to take this. Committed at http://drupalcode.org/project/facetapi.git/commit/acc830f.
Comment #5
natukSorry, too scared. But thanks.