private function userCanViewArtifact(PFUser $user, Tracker_Artifact $artifact) { if ($artifact->useArtifactPermissions()) { $rows = $artifact->permission_db_authorized_ugroups(Tracker_Artifact::PERMISSION_ACCESS); if ($rows !== false) { foreach ($rows as $row) { if ($this->userBelongsToGroup($user, $artifact, $row['ugroup_id'])) { return true; } } } return false; } return true; }
public function save(Tracker_Artifact $artifact) { return $this->getDao()->save($artifact->getId(), $artifact->getTrackerId(), $artifact->useArtifactPermissions()); }
/** * Fetch the html code to display the field value in tooltip * * @param Tracker_Artifact $artifact * @param Tracker_Artifact_ChangesetValue_PermissionsOnArtifact $value The changeset value for this field * @return string */ protected function fetchTooltipValue(Tracker_Artifact $artifact, Tracker_Artifact_ChangesetValue $value = null) { $html = ''; if ($value && $artifact->useArtifactPermissions()) { $ugroup_dao = $this->getUGroupDao(); $perms = $value->getPerms(); $perms_name = array(); foreach ($perms as $perm) { $row = $ugroup_dao->searchByUGroupId($perm)->getRow(); $perms_name[] = util_translate_name_ugroup($row['name']); } $html .= implode(",", $perms_name); } return $html; }