Changeset 38195 for trunk/pstamp/scripts/pstampparse.pl
- Timestamp:
- Apr 27, 2015, 1:52:41 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/pstampparse.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstampparse.pl
r38160 r38195 200 200 201 201 202 203 my $label_changed = 0; 204 if (0) { 202 205 # Adjust the label for requests coming in over the web upload interface 203 206 # XXX: do this later based on the user information 204 205 my $label_changed = 0;206 207 # We now use the access tabels to set the label. 207 if (0) {208 208 if ($label and $label eq "WEB.UP") { 209 209 my $lcname = lc($req_name); … … 234 234 } 235 235 236 # XXX: update these comments 237 # product passed in is either one specific to the submitting pstampDataStore or the default 238 # "pstampresults" 239 # Here, we need to decide whether to change that based on email 240 # WE can't use label (yet) because the PSI cgi script sets it to PSI 241 # Do we ever need to use label? Is it obsolete? Check test procedures. 242 236 # based on the user's email address get the accessLevel, default label and data store product 243 237 my $productForUser; 244 my $labelForUser = $label; # for now I pass the current label for use in hacking permissions for V1 requests238 my $labelForUser = $label; # XXX: for now I pass the current label for use in hacking permissions for V1 requests. 245 239 246 240 my $accessLevel = getUsersAccessLevel($email, \$labelForUser, \$productForUser); 247 241 if ($accessLevel < 0) { 248 print STDERR "Data access is forbidden .\n";242 print STDERR "Data access is forbidden for $email.\n"; 249 243 insertFakeJobForRow(undef, 0, $PSTAMP_NOT_AUTHORIZED); 250 244 } 251 245 252 # if the request came through the upload channel, change it to the user's specific label246 # if the request came through the request table upload channel, change it to the user's specific label 253 247 # if any is known. Do we want to do this for any other channels? 248 # requests from data store will have those values. 254 249 if ($label and $label eq 'WEB.UP') { 255 250 if ($labelForUser) { … … 259 254 } 260 255 261 # XXX: Think through when and if we change the product.262 256 # If the product is the system default, set it to the product for the user@domain. That way 263 257 # if the request came through a data store that target will be used. 264 # We really only need to redirect the results with greater access level than the default 258 # We really only need to redirect the results with greater access level than the default. 259 # note that for most users productForUser will be undef so the default will be used. 265 260 if ($productIsDefault or $product eq 'NULL') { 266 261 if ($productForUser) { … … 297 292 } 298 293 294 # in these two error conditions we are done. The invoking script will finish up. 299 295 if ($duplicate_req_name) { 300 296 exit 0; … … 378 374 379 375 if (($action eq 'LIST' or $mode eq "queue_job") and ($num_jobs eq 0)) { 380 # this should not happen. The function aboveis required to insert a fake job for any376 # this should not happen. The processRow is required to insert a fake job for any 381 377 # rows that did not yield any jobs. 382 378 print STDERR "ERROR: zero jobs created for $req_name\n"; … … 594 590 my $rownum = $row->{ROWNUM}; 595 591 592 my $mjd_max; 593 my $adjustedDateCuts = adjustDateCuts($row, \$mjd_max); 594 if ($adjustedDateCuts and $mjd_max < 0) { 595 print STDERR "User is not authorized for data from this project.\n"; 596 insertFakeJobForRow($row, 1, $PSTAMP_NOT_AUTHORIZED); 597 $num_jobs++; 598 return $num_jobs; 599 } 600 596 601 # Since user can get unmagicked data "by coordinate" requests can go back in time 597 602 # to dredge unusable data from the "dark days"... … … 608 613 # if this user does not have unlimited access rights adjust the date cut 609 614 # to avoid more recent data 610 my $mjd_max;611 615 # We do not adjust dates for stacks since they are not well defined enough. 612 616 # We'll need to filter them by accessLevel during the lookup 613 617 my $stage = $row->{IMG_TYPE}; 614 if ($stage ne 'stack' and adjustDateCuts($row, \$mjd_max)) {618 if ($stage ne 'stack' and $adjustedDateCuts) { 615 619 # if lower limit was supplied by user we can leave the value alone 616 620 if ($row->{MJD_MAX}) {
Note:
See TracChangeset
for help on using the changeset viewer.
