コード例 #1
0
ファイル: Case.php プロジェクト: aldridged/gtg-sugar
 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;
 }
コード例 #2
0
ファイル: Case.php プロジェクト: sacredwebsite/SuiteCRM
 function listviewACLHelper()
 {
     $array_assign = parent::listviewACLHelper();
     $is_owner = false;
     $in_group = false;
     //SECURITY GROUPS
     if (!empty($this->account_id)) {
         if (!empty($this->account_id_owner)) {
             global $current_user;
             $is_owner = $current_user->id == $this->account_id_owner;
         } else {
             global $current_user;
             $parent_bean = BeanFactory::getBean('Accounts', $this->account_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('Accounts', $this->account_id, 'view');
         /* END - SECURITY GROUPS */
     }
     /* BEGIN - SECURITY GROUPS */
     /**
     if(!ACLController::moduleSupportsACL('Accounts') || ACLController::checkAccess('Accounts', 'view', $is_owner)){
     */
     if (!ACLController::moduleSupportsACL('Accounts') || ACLController::checkAccess('Accounts', 'view', $is_owner, 'module', $in_group)) {
         /* END - SECURITY GROUPS */
         $array_assign['ACCOUNT'] = 'a';
     } else {
         $array_assign['ACCOUNT'] = 'span';
     }
     return $array_assign;
 }