/** * Retrieve the list of changed fields for this activity that the user has ACL permissions to see * @param User $user * @param SugarBean $bean * @return array List of fields the user has ACL permission to see */ protected function getChangedFieldsForUser(User $user, SugarBean $bean) { $fields = array(); $activityData = $this->getDataArray(); if ($this->activity_type === 'update' && isset($activityData['changes'])) { foreach ($activityData['changes'] as $field) { $fields[$field['field_name']] = 1; } $context = array('user' => $user); $bean->ACLFilterFieldList($fields, $context); $fields = array_keys($fields); } return $fields; }