Commit 6d43ee26 authored by salvis's avatar salvis

Avoid marking inactive grant records as granting access.

parent cbe5fa80
......@@ -258,6 +258,7 @@ function devel_node_access_block($op = 'list', $delta = 0) {
'illegitimate' => array(t('illegitimate'), 'error', t('Should NOT be in !na because of lower priority!', $tokens)),
'alien' => array(t('alien'), 'error', t('Should NOT be in !na because of unknown origin!', $tokens)),
);
$active_states = array('default', 'ok', 'static', 'unexpected', 'illegitimate', 'alien');
$headers = array(t('node'), t('prio'), t('status'), t('realm'), t('gid'), t('view'), t('update'), t('delete'), t('explained'));
$active_grants = array();
while ($active_grant = db_fetch_object($result)) {
......@@ -391,7 +392,7 @@ function devel_node_access_block($op = 'list', $delta = 0) {
$row = (array) $row;
foreach (array('view', 'update', 'delete') as $op) {
$row["grant_$op"] = array('data' => $row["grant_$op"]);
if ((isset($checked_grants[$grant['nid']][$op][$grant['realm']]) && in_array($grant['gid'], $checked_grants[$grant['nid']][$op][$grant['realm']]) || ($row['nid'] == 0 && $row['gid'] == 0 && $row['realm'] == 'all')) && !empty($row["grant_$op"]['data'])) {
if ((isset($checked_grants[$grant['nid']][$op][$grant['realm']]) && in_array($grant['gid'], $checked_grants[$grant['nid']][$op][$grant['realm']]) || ($row['nid'] == 0 && $row['gid'] == 0 && $row['realm'] == 'all')) && !empty($row["grant_$op"]['data']) && in_array($grant['state'], $active_states)) {
$row["grant_$op"]['data'] .= '′';
$row["grant_$op"]['title'] = t('This entry grants access to this node to this user.');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment