Avoid marking inactive grant records as granting access.
authorsalvis
Fri, 18 Dec 2009 23:48:50 +0000 (23:48 +0000)
committersalvis
Fri, 18 Dec 2009 23:48:50 +0000 (23:48 +0000)
devel_node_access.module

index 9d5fca5..0bb6b4a 100644 (file)
@@ -275,6 +275,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!', $variables)),
               'alien'        => array(t('alien'),        'error',   t('Should NOT be in !na because of unknown origin!', $variables)),
             );
+            $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)) {
@@ -421,7 +422,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.');
                 }