Hello,
this module is great, but missing one important thing. We used links in our newsletter, but not logged in users are redirected to 404 page. It's very confusing. We should return 403 page. But because function taxonomy_permissions_query_term_access_alter it will be hard.
I created quickfix for this scenario I hope someone has better idea
/**
* Implements hook_init().
*/
function MODULE_init() {
if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2)) && empty(arg(3))) {
// we cannot use taxonomy_term_load because implementation of taxonomy_permissions_query_term_access_alter
// we cannot use access callback because its never accessed for 404
// we cannot use in hook_page_build because its never called from 404
// we need to access vocabulary directly from database
$vid = db_select('taxonomy_term_data', 't')
->fields('t',array('vid'))
->condition('tid', arg(2), '=')
->execute()
->fetchField();
if(!user_access('view terms in ' . $vid)) {
drupal_access_denied();
}
}
}
Comments