Hi,
One more bug. When you create the field_secured_areas for a content type and you set it to allow multiple term selection, the module doesn't work.
The bug takes place in the AccessCheckService.php file, method names canUserAccessByNodeId().
In this method you have a foreach on each taxonomy term allowed for this content. If the first taxonomy term is not rattached to the current user rights, then the foreach breaks and there is no check for the next taxonomy term (the next role).
This is the actual code :
if (!empty($aReferencedTaxonomyTerms)) {
foreach ($aReferencedTaxonomyTerms as $aReferencedTerm) {
if (isset($aReferencedTerm['target_id']) &&
$this->isAccessAllowedByDatabase($aReferencedTerm['target_id']) === TRUE
) {
return TRUE;
}
if (!isset($user_is_allowed_to_view)) {
return FALSE;
}
}
}And the quick fix :
if (!empty($aReferencedTaxonomyTerms)) {
$user_is_allowed_to_view = FALSE;
foreach ($aReferencedTaxonomyTerms as $aReferencedTerm) {
if (isset($aReferencedTerm['target_id']) &&
$this->isAccessAllowedByDatabase($aReferencedTerm['target_id']) === TRUE
) {
$user_is_allowed_to_view = TRUE;
}
}
return $user_is_allowed_to_view;
}
return TRUE;Best regards,
Comments
Comment #2
Smiff commentedComment #3
Smiff commentedComment #4
Smiff commentedComment #6
jepster_Thanks Smiff for your bug report. I have fixed the issue in the dev branch. Afterwards I have created a bugfix release together with your second bug report.