summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfago2012-09-06 12:23:34 (GMT)
committer fago2012-09-06 12:23:34 (GMT)
commitb91bda4925c5c17232aa646f0d4cdec4828cfc01 (patch)
treeb9fc3beed30edc10318ed211ae84f3077ca706f2
parent90768fd5153972d0f995c32943bc5f4e79676a76 (diff)
Incorporate revision specific access if a non default node revision is passed to entity_access().
-rw-r--r--modules/callbacks.inc9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/callbacks.inc b/modules/callbacks.inc
index cf72666..5203028 100644
--- a/modules/callbacks.inc
+++ b/modules/callbacks.inc
@@ -605,7 +605,14 @@ function entity_metadata_field_file_validate_item($items, $context) {
*/
function entity_metadata_no_hook_node_access($op, $node = NULL, $account = NULL) {
if (isset($node)) {
- return node_access($op, $node, $account);
+ // If a non-default revision is given, incorporate revision access.
+ $default_revision = node_load($node->nid);
+ if ($node->vid != $default_revision->vid) {
+ return _node_revision_access($node, $op);
+ }
+ else {
+ return node_access($op, $node, $account);
+ }
}
// Is access to all nodes allowed?
if (!user_access('access content', $account)) {