Browse Source

Fixed permissoins problem for compatability with the node_privacy_by_role module

spficklin 13 years ago
parent
commit
e51634c8f3
1 changed files with 12 additions and 9 deletions
  1. 12 9
      tripal_analysis/tripal_analysis.module

+ 12 - 9
tripal_analysis/tripal_analysis.module

@@ -770,26 +770,29 @@ function tripal_analysis_help($path, $arg) {
  * @ingroup tripal_analysis
  */
 function chado_analysis_access($op, $node, $account){
+
 	if ($op == 'create') {
-		return user_access('create chado_analysis content', $account);
+		if(!user_access('create chado_analysis content', $account)){
+			return FALSE;
+      }
 	}
 
 	if ($op == 'update') {
-		if (user_access('edit chado_analysis content', $account)) {
-			return TRUE;
+		if (!user_access('edit chado_analysis content', $account)) {
+			return FALSE;
 		}
 	}
 	if ($op == 'delete') {
-		if (user_access('delete chado_analysis content', $account)) {
-			return TRUE;
+		if (!user_access('delete chado_analysis content', $account)) {
+			return FALSE;
 		}
 	}
 	if ($op == 'view') {
-		if (user_access('access chado_analysis content', $account) && tripal_check_permission_by_node_id($node->nid)) {
-			return TRUE;
-		}
+		if(!user_access('access chado_analysis content', $account)){
+         return FALSE;
+      }
 	}
-	return FALSE;
+   return NULL;
 }
 
 /**