diff --git a/flag.module b/flag.module
index 957bb12..8ef4f0a 100644
--- a/flag.module
+++ b/flag.module
@@ -1836,3 +1836,76 @@ function flag_set_sid($uid = NULL, $create = TRUE) {
 function flag_get_sid($uid = NULL, $create = FALSE) {
   return flag_set_sid($uid, $create);
 }
+
+/**
+ * Implements hook_entity_property_info().
+ */
+function flag_entity_property_info() {
+  $info = array();
+  foreach (flag_get_flags() as $flag) {
+    // We only support flags on entities.
+    if (entity_get_info($flag->content_type)) {
+      $info['user']['properties']['flag_' . $flag->name . '_content'] = array(
+        'label' => t('Flagged @entity-type with flag @flag.', array('@entity-type' => $flag->content_type, '@flag' => $flag->name)),
+        'type' => 'list<' . $flag->content_type . '>',
+        'getter callback' => 'flag_properties_get_flagged_content',
+        'computed' => TRUE,
+        'flag_name' => $flag->name,
+      );
+      if (count($flag->types)) {
+        foreach ($flag->types as $type) {
+          $info[$flag->content_type]['bundles'][$type]['properties']['flag_' . $flag->name . '_user'] = flag_entity_property_user_definition($type, $flag);
+        }
+      }
+      else {
+        $info[$flag->content_type]['properties']['flag_' . $flag->name . '_user'] = flag_entity_property_user_definition($flag->content_type, $flag);
+      }
+    }
+  }
+  return $info;
+}
+
+/**
+ * Helper function that returns the entity property definition for user who have
+ * flagged a certain entity.
+ *
+ * @type The type can either be the bundle or the entity type
+ * @flag The flag object
+ */
+function flag_entity_property_user_definition($type, $flag) {
+  return array(
+    'label' => t('The users who have flagged the @type with flag @flag.', array('@type' => $type, '@flag' => $flag->name)),
+    'type' => 'list<user>',
+    'getter callback' => 'flag_properties_get_flagging_users',
+    'computed' => TRUE,
+    'flag_name' => $flag->name,
+  );
+}
+
+/**
+ * Returns entities the user has flagged.
+ */
+function flag_properties_get_flagged_content($entity, array $options, $name, $entity_type, $property_info) {
+  $flag = flag_get_flag($property_info['flag_name']);
+  $result = db_select('flag_content', 'fc')
+    ->fields('fc', array('content_id'))
+    ->condition('fid', $flag->fid)
+    ->condition('uid', $entity->uid)
+    ->execute();
+  return $result->fetchCol();
+}
+
+/**
+ * Returns users who flagged an entity.
+ */
+function flag_properties_get_flagging_users($entity, array $options, $name, $entity_type, $property_info) {
+  $flag = flag_get_flag($property_info['flag_name']);
+  $result = db_select('flag_content', 'fc')
+    ->fields('fc', array('uid'))
+    ->condition('content_type', $flag->content_type)
+    ->condition('content_id', $flag->get_content_id($entity))
+    ->condition('fid', $flag->fid)
+    ->execute();
+  // Filter out anonymous users.
+  return array_filter($result->fetchCol());
+}
\ No newline at end of file
