Ejemplo n.º 1
0
 /**
  * Extends SugarBean::listviewACLHelper
  *
  * @return array
  */
 public function listviewACLHelper()
 {
     $array_assign = parent::listviewACLHelper();
     $is_owner = false;
     if (!ACLController::moduleSupportsACL('Accounts') || ACLController::checkAccess('Accounts', 'view', $is_owner)) {
         $array_assign['ACCOUNT'] = 'a';
     } else {
         $array_assign['ACCOUNT'] = 'span';
     }
     return $array_assign;
 }
Ejemplo n.º 2
0
 function listviewACLHelper()
 {
     $array_assign = parent::listviewACLHelper();
     $is_owner = false;
     if (!empty($this->parent_name)) {
         if (!empty($this->parent_name_owner)) {
             global $current_user;
             $is_owner = $current_user->id == $this->parent_name_owner;
         }
     }
     if (!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner)) {
         $array_assign['PARENT'] = 'a';
     } else {
         $array_assign['PARENT'] = 'span';
     }
     $is_owner = false;
     if (!empty($this->contact_name)) {
         if (!empty($this->contact_name_owner)) {
             global $current_user;
             $is_owner = $current_user->id == $this->contact_name_owner;
         }
     }
     if (ACLController::checkAccess('Contacts', 'view', $is_owner)) {
         $array_assign['CONTACT'] = 'a';
     } else {
         $array_assign['CONTACT'] = 'span';
     }
     return $array_assign;
 }
Ejemplo n.º 3
0
 function listviewACLHelper()
 {
     $array_assign = parent::listviewACLHelper();
     $is_owner = false;
     $in_group = false;
     //SECURITY GROUPS
     if (!empty($this->parent_name)) {
         if (!empty($this->parent_name_owner)) {
             global $current_user;
             $is_owner = $current_user->id == $this->parent_name_owner;
         } else {
             if (!empty($this->parent_type) && !empty($this->parent_id)) {
                 global $current_user;
                 $parent_bean = BeanFactory::getBean($this->parent_type, $this->parent_id);
                 if ($parent_bean !== false) {
                     $is_owner = $current_user->id == $parent_bean->assigned_user_id;
                 }
             }
         }
         require_once "modules/SecurityGroups/SecurityGroup.php";
         $in_group = SecurityGroup::groupHasAccess($this->parent_type, $this->parent_id, 'view');
         /* END - SECURITY GROUPS */
     }
     /* BEGIN - SECURITY GROUPS */
     /**
     if(!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner)){
     */
     if (!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner, 'module', $in_group)) {
         /* END - SECURITY GROUPS */
         $array_assign['PARENT'] = 'a';
     } else {
         $array_assign['PARENT'] = 'span';
     }
     $is_owner = false;
     $in_group = false;
     //SECURITY GROUPS
     if (!empty($this->contact_name)) {
         if (!empty($this->contact_name_owner)) {
             global $current_user;
             $is_owner = $current_user->id == $this->contact_name_owner;
         } else {
             global $current_user;
             $parent_bean = BeanFactory::getBean('Contacts', $this->contact_id);
             if ($parent_bean !== false) {
                 $is_owner = $current_user->id == $parent_bean->assigned_user_id;
             }
         }
         require_once "modules/SecurityGroups/SecurityGroup.php";
         $in_group = SecurityGroup::groupHasAccess('Contacts', $this->contact_id, 'view');
         /* END - SECURITY GROUPS */
     }
     /* BEGIN - SECURITY GROUPS */
     /**
     if( ACLController::checkAccess('Contacts', 'view', $is_owner)){
     */
     if (ACLController::checkAccess('Contacts', 'view', $is_owner, 'module', $in_group)) {
         /* END - SECURITY GROUPS */
         $array_assign['CONTACT'] = 'a';
     } else {
         $array_assign['CONTACT'] = 'span';
     }
     return $array_assign;
 }
Ejemplo n.º 4
0
 function listviewACLHelper()
 {
     $array_assign = parent::listviewACLHelper();
     $is_owner = false;
     if (!empty($this->account_id)) {
         if (!empty($this->account_id_owner)) {
             global $current_user;
             $is_owner = $current_user->id == $this->account_id_owner;
         }
     }
     if (!ACLController::moduleSupportsACL('Accounts') || ACLController::checkAccess('Accounts', 'view', $is_owner)) {
         $array_assign['ACCOUNT'] = 'a';
     } else {
         $array_assign['ACCOUNT'] = 'span';
     }
     return $array_assign;
 }
Ejemplo n.º 5
0
 function listviewACLHelper()
 {
     $array_assign = parent::listviewACLHelper();
     $is_owner = false;
     if (!empty($this->parent_name)) {
         if (!empty($this->parent_name_owner)) {
             global $current_user;
             $is_owner = $current_user->id == $this->parent_name_owner;
         }
     }
     if (ACLController::checkAccess('Project', 'view', $is_owner)) {
         $array_assign['PARENT'] = 'a';
     } else {
         $array_assign['PARENT'] = 'span';
     }
     $is_owner = false;
     if (!empty($this->depends_on_name)) {
         if (!empty($this->depends_on_name_owner)) {
             global $current_user;
             $is_owner = $current_user->id == $this->depends_on_name_owner;
         }
     }
     if (ACLController::checkAccess('ProjectTask', 'view', $is_owner)) {
         $array_assign['PARENT_TASK'] = 'a';
     } else {
         $array_assign['PARENT_TASK'] = 'span';
     }
     return $array_assign;
 }
Ejemplo n.º 6
0
 /**
  * {@inheritdoc}
  */
 public function listviewACLHelper()
 {
     $array_assign = parent::listviewACLHelper();
     $is_owner = false;
     if (!empty($this->contact_name)) {
         if (!empty($this->contact_name_owner)) {
             global $current_user;
             $is_owner = $current_user->id == $this->contact_name_owner;
         }
     }
     if (ACLController::checkAccess('Contacts', 'view', $is_owner)) {
         $array_assign['CONTACT'] = 'a';
     } else {
         $array_assign['CONTACT'] = 'span';
     }
     $is_owner = false;
     if (!empty($this->account_name)) {
         if (!empty($this->account_name_owner)) {
             global $current_user;
             $is_owner = $current_user->id == $this->account_name_owner;
         }
     }
     if (ACLController::checkAccess('Accounts', 'view', $is_owner)) {
         $array_assign['ACCOUNT'] = 'a';
     } else {
         $array_assign['ACCOUNT'] = 'span';
     }
     $is_owner = false;
     if (!empty($this->quote_name)) {
         if (!empty($this->quote_name_owner)) {
             global $current_user;
             $is_owner = $current_user->id == $this->quote_name_owner;
         }
     }
     if (ACLController::checkAccess('Quotes', 'view', $is_owner)) {
         $array_assign['QUOTE'] = 'a';
     } else {
         $array_assign['QUOTE'] = 'span';
     }
     return $array_assign;
 }
Ejemplo n.º 7
0
 function listviewACLHelper()
 {
     $array_assign = parent::listviewACLHelper();
     $is_owner = false;
     if (!empty($this->name)) {
         if (!empty($this->opportunity_owner)) {
             global $current_user;
             $is_owner = $current_user->id == $this->opportunity_owner;
         }
     }
     if (ACLController::checkAccess('Opportunities', 'view', $is_owner)) {
         $array_assign['OPPORTUNITY'] = 'a';
     } else {
         $array_assign['OPPORTUNITY'] = 'span';
     }
     return $array_assign;
 }
Ejemplo n.º 8
0
 function listviewACLHelper()
 {
     $array_assign = parent::listviewACLHelper();
     $is_owner = false;
     //if(!empty($this->manufacturerid))
     if (!empty($this->account_id)) {
         if (!empty($this->account_id_owner)) {
             global $current_user;
             $is_owner = $current_user->id == $this->account_id_owner;
             //$subUserIds = User::get_sub_userids($current_user->id);
             //array_push($subUserIds, $current_user->id);
             //$is_owner = in_array($this->account_id_owner, $subUserIds);
         }
     }
     //if(!ACLController::moduleSupportsACL('Accounts') || ACLController::checkAccess('Accounts', 'view', $is_owner, $this->manufacturerid)){
     if (!ACLController::moduleSupportsACL('Accounts') || ACLController::checkAccess('Accounts', 'view', $is_owner)) {
         $array_assign['ACCOUNT'] = 'a';
     } else {
         $array_assign['ACCOUNT'] = 'span';
     }
     return $array_assign;
 }
Ejemplo n.º 9
0
 public function listviewACLHelper()
 {
     global $current_user;
     $array_assign = parent::listviewACLHelper();
     $is_owner = false;
     if (!empty($this->shipping_account_name)) {
         if (!empty($this->shipping_account_name_owner)) {
             $is_owner = $current_user->id == $this->shipping_account_name_owner;
         }
     }
     if (ACLController::checkAccess('Accounts', 'view', $is_owner)) {
         $array_assign['SHIPPING_ACCOUNT'] = 'a';
     } else {
         $array_assign['SHIPPING_ACCOUNT'] = 'span';
     }
     $is_owner = false;
     if (!empty($this->billing_account_name)) {
         if (!empty($this->billing_account_name_owner)) {
             $is_owner = $current_user->id == $this->billing_account_name_owner;
         }
     }
     if (ACLController::checkAccess('Accounts', 'view', $is_owner)) {
         $array_assign['BILLING_ACCOUNT'] = 'a';
     } else {
         $array_assign['BILLING_ACCOUNT'] = 'span';
     }
     $is_owner = false;
     if (!empty($this->shipping_contact_name)) {
         if (!empty($this->shipping_contact_name_owner)) {
             $is_owner = $current_user->id == $this->shipping_contact_name_owner;
         }
     }
     if (ACLController::checkAccess('Contacts', 'view', $is_owner)) {
         $array_assign['SHIPPING_CONTACT'] = 'a';
     } else {
         $array_assign['SHIPPING_CONTACT'] = 'span';
     }
     $is_owner = false;
     if (!empty($this->billing_contact_name)) {
         if (!empty($this->billing_contact_name_owner)) {
             $is_owner = $current_user->id == $this->billing_contact_name_owner;
         }
     }
     if (ACLController::checkAccess('Contacts', 'view', $is_owner)) {
         $array_assign['BILLING_CONTACT'] = 'a';
     } else {
         $array_assign['BILLING_CONTACT'] = 'span';
     }
     $is_owner = false;
     if (!empty($this->opportunity_name)) {
         if (!empty($this->opportunity_name_owner)) {
             $is_owner = $current_user->id == $this->opportunity_name_owner;
         }
     }
     if (ACLController::checkAccess('Opportunities', 'view', $is_owner)) {
         $array_assign['OPPORTUNITY'] = 'a';
     } else {
         $array_assign['OPPORTUNITY'] = 'span';
     }
     return $array_assign;
 }
Ejemplo n.º 10
0
	function listviewACLHelper(){
		$array_assign = parent::listviewACLHelper();
		$is_owner = false;
		$in_group = false; //SECURITY GROUPS
		if(!empty($this->parent_name)){

			if(!empty($this->parent_name_owner)){
				global $current_user;
				$is_owner = $current_user->id == $this->parent_name_owner;
			}
			/* BEGIN - SECURITY GROUPS */
			//parent_name_owner not being set for whatever reason so we need to figure this out
			else if(!empty($this->parent_type) && !empty($this->parent_id)) {
				global $current_user;
                $parent_bean = BeanFactory::getBean($this->parent_type,$this->parent_id);
                if($parent_bean !== false) {
                	$is_owner = $current_user->id == $parent_bean->assigned_user_id;
                }
			}
			require_once("modules/SecurityGroups/SecurityGroup.php");
			$in_group = SecurityGroup::groupHasAccess($this->parent_type, $this->parent_id, 'view'); 
        	/* END - SECURITY GROUPS */
		}
			/* BEGIN - SECURITY GROUPS */
			/**
			if(ACLController::checkAccess('Project', 'view', $is_owner)){
			*/
			if(ACLController::checkAccess('Project', 'view', $is_owner, 'module', $in_group)){
        	/* END - SECURITY GROUPS */
				$array_assign['PARENT'] = 'a';
			}else{
				$array_assign['PARENT'] = 'span';
			}
		$is_owner = false;
		if(!empty($this->depends_on_name)){

			if(!empty($this->depends_on_name_owner)){
				global $current_user;
				$is_owner = $current_user->id == $this->depends_on_name_owner;
			}
		}
			if( ACLController::checkAccess('ProjectTask', 'view', $is_owner)){
				$array_assign['PARENT_TASK'] = 'a';
			}else{
				$array_assign['PARENT_TASK'] = 'span';
			}

		return $array_assign;
	}