From 8d372d9b799b05059b535912db9f9a73fe24a4e0 Mon Sep 17 00:00:00 2001
From: jpayne <jpayne@696648.no-reply.drupal.org>
Date: Fri, 27 Apr 2012 00:30:09 -0400
Subject: [PATCH] Issue #1512950 by acrazyanimal: Temporary fix to add in the required access callback. For now we return true since most access handling is through ECK itself. Still need to work on a better solution for [#1374150].

---
 eck.entity_type.inc |    2 +-
 eck.module          |   13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/eck.entity_type.inc b/eck.entity_type.inc
index 71660f4..366c5b2 100644
--- a/eck.entity_type.inc
+++ b/eck.entity_type.inc
@@ -368,7 +368,7 @@ function eck__entity_type__info($entity_type) {
     'base table' => "eck_{$entity_type->name}",
     'entity class' => $entity_class,
     'controller class' => $controller_class,
-    'access callback' => "user_access",
+    'access callback' => 'eck__entity_access',
     'module' => 'eck',
     'fieldable' => TRUE,
     'entity keys' => array(
diff --git a/eck.module b/eck.module
index 8566d90..a1339c2 100644
--- a/eck.module
+++ b/eck.module
@@ -813,3 +813,16 @@ function eck_entity_delete($entity, $entity_type){
       array('entity' => $entity));
   }
 }
+
+/**
+ * Access callback for ECK entities
+ * 
+ * TODO: turn this into a proper access callback. For now we just
+ * return true so other modules calling the entity_access will be
+ * able to display ECK entities and their fields.
+ * 
+ * Examples that require this are rules, views, entityreference...
+ */
+function eck__entity_access($op, $entity = NULL, $account = NULL, $entity_type = NULL) {
+  return TRUE;
+}
-- 
1.7.2.3

