Closed (fixed)
Project:
RedHen CRM
Version:
7.x-1.x-dev
Component:
Shared
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
7 Sep 2012 at 15:49 UTC
Updated:
23 Jun 2014 at 23:33 UTC
Jump to comment: Most recent
There are no access checks applied to e.g. "edit" and "delete" links presented on entity overview screens. Since these screens are potentially accessible to users without edit or delete permissions, inappropriate links are visible. (This is not a security issue, as following these links produces an access denied page.)
The following code from node_admin_nodes() is a good model:
// Build a list of all the accessible operations for the current node.
$operations = array();
if (node_access('update', $node)) {
$operations['edit'] = array(
'title' => t('edit'),
'href' => 'node/' . $node->nid . '/edit',
'query' => $destination,
);
}
if (node_access('delete', $node)) {
$operations['delete'] = array(
'title' => t('delete'),
'href' => 'node/' . $node->nid . '/delete',
'query' => $destination,
);
}
However, currently these links are generated in theme functions like theme_redhen_contact_list(). Before adding more logic at the theming level, it would be good to refactor and pull the existing logic out of theme functions.
Comments
Comment #1
levelos commentedThanks @nedjo, good catch. We'll get on it unless a patch comes in first.
Comment #2
nedjo@levelos, I considered working up a quick patch but it really seems like this should be fixed as part of a refactoring, so I opened #1778146: Pull entity listing logic out of theming functions.
Comment #3
levelos commentedComment #4
tauno commentedFixed as part of working on #1778146: Pull entity listing logic out of theming functions