Index: trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/custom_functions.php
===================================================================
--- trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/custom_functions.php	(revision 524)
+++ trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/custom_functions.php	(revision 527)
@@ -1,8 +1,39 @@
 <?php
+function xpress_user_access_level(){
+	global $current_user;
+	
+	$level = @$current_user->user_level;
+	$role = @$current_user->roles[0];
+	switch ($role){
+		case 'administrator':
+			$role_level = 10;
+			break;
+		case 'editor':
+			$role_level = 7;
+			break;
+		case 'author':
+			$role_level = 2;
+			break;		
+		case 'contributor':
+			$role_level = 1;
+			break;
+		default:
+			$role_level = 0;
+	}
+	
+	if ($level > $role_level){
+		return $level;
+	} else {
+		return $role_level;
+	}
+}
+
+
+
 function xpress_is_contributor()
 {
 	global $current_user;
 	get_currentuserinfo();
-	if ($current_user->user_level > 3)
+	if (xpress_user_access_level() > 3)
 		return true;
 	else
@@ -21,4 +52,13 @@
 	if (defined('MULTISITE')) return MULTISITE;
 	return $xoops_config->multiblog;
+}
+
+function xpress_is_multiblog_root() {
+	global $blog_id;
+	if (defined('MULTISITE') && MULTISITE && $blog_id == 1){
+		return true;
+	} else {
+		return false;
+	}
 }
 
@@ -143,5 +183,5 @@
 	extract( $r );
 	
-	$output = @$current_user->user_level;
+	$output = xpress_user_access_level();
 	if ($echo)
 		echo $output;
