--- rooms_node.module	2014-10-14 13:00:53.539517600 +0100
+++ rooms_node.module	2014-10-14 18:16:39.666174100 +0100
@@ -22,8 +22,8 @@
     'title' => 'Availability',
     'page callback' => 'rooms_node_availability',
     'page arguments' => array(1),
-    //'access callback' => 'rooms_node_is_enabled',
-    'access arguments' => array('administer availability'),
+    'access callback' => 'rooms_node_availability_accessible',
+    'access arguments' => array(1),
     //'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
     'weight' => '60',
     'type' => MENU_LOCAL_TASK,
@@ -32,8 +32,8 @@
     'title' => 'Prices',
     'page arguments' => array(1),
     'page callback' => 'rooms_node_prices',
-    //'access callback' => 'rooms_node_is_enabled',
-    'access arguments' => array('administer prices'),
+    'access callback' => 'rooms_node_prices_accessible',
+    'access arguments' => array(1),
     'weight' => '70',
     'type' => MENU_LOCAL_TASK,
   );
@@ -46,10 +46,18 @@
       'title' => t('Administer availability'),
       'description' => t('Administer availability.'),
     ),
+    'Manage own availability' => array(
+          'title' => t('Manage own availability'),
+          'description' => t('Manage own unit availability.'),
+    ),
     'administer prices' => array(
       'title' => t('Administer prices'),
       'description' => t('Administer prices.'),
     ),
+    'Manage own prices' => array(
+          'title' => t('Manage own prices'),
+          'description' => t('Manage own prices.'),
+    ),
   );
 }
 
@@ -645,10 +653,58 @@
 /*
 * Check if rooms_node is enabled for this content type
 */
-function rooms_node_is_enabled($nid) {
+function rooms_node_prices_accessible($nid) {
+
+  $node = node_load($nid);
+  $enabled = variable_get('rooms_node_' . $node->type);
+  $enabled == 1 ? TRUE : FALSE;
+  if ($enabled == FALSE) {
+	return FALSE;
+	break;
+  }
+  if ($enabled == TRUE) {
+	// Get the current user object  
+	global $user;
+	$guid = $user->uid;
+	$nodeuid = $node->uid;
+	$is_admin = user_access('administer availability');
+	$can_manage_own = user_access('Manage own prices');
+	if ($is_admin || $can_manage_own && $nodeuid == $guid){
+	return TRUE;	
+	}
+	else {
+	return FALSE;
+	}
+  }
+  
+  
+}
+
+function rooms_node_availability_accessible($nid) {
+
   $node = node_load($nid);
   $enabled = variable_get('rooms_node_' . $node->type);
-  return $enabled == 1 ? TRUE : FALSE;
+  $enabled == 1 ? TRUE : FALSE;
+  if ($enabled == FALSE) {
+	return FALSE;
+	break;
+  }
+  if ($enabled == TRUE) {
+	// Get the current user object  
+	global $user;
+	$guid = $user->uid;
+	$nodeuid = $node->uid;
+	$is_admin = user_access('administer availability');
+	$can_manage_own = user_access('Manage own availability');
+	if ($is_admin || $can_manage_own && $nodeuid == $guid){
+	return TRUE;	
+	}
+	else {
+	return FALSE;
+	}
+  }
+  
+  
 }
 
 
