Changeset 38133 for trunk/pstamp/scripts/pstampparse.pl
- Timestamp:
- Apr 16, 2015, 1:56:14 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/pstampparse.pl (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstampparse.pl
r38132 r38133 177 177 my $exitStatus = $error_code >> 8; 178 178 if ($success) { 179 # -listreq succeeded duplicate requestname179 # -listreq succeeded there is already a request in the database with this name 180 180 print STDERR "REQ_NAME $req_name has already been used\n"; 181 181 insertFakeJobForRow(undef, 0, $PSTAMP_DUP_REQUEST); … … 192 192 193 193 my $label_changed = 0; 194 # see below194 # We now use the access tabels to set the label. 195 195 if (0) { 196 196 if ($label and $label eq "WEB.UP") { … … 222 222 } 223 223 224 # XXX: update these comments 224 225 # product passed in is either one specific to the submitting pstampDataStore or the default 225 226 # "pstampresults" … … 228 229 # Do we ever need to use label? Is it obsolete? Check test procedures. 229 230 230 # XXX perhaps do this prior to label setting above after domain/user table is implemented231 231 my $productForUser; 232 my $labelForUser = $label; 232 my $labelForUser = $label; # for now I pass the current label for use in hacking permissions for V1 requests 233 233 234 my $accessLevel = getUsersAccessLevel($email, \$labelForUser, \$productForUser); 234 235 if ($accessLevel < 0) { … … 237 238 } 238 239 240 # if the request came through the upload channel, change it to the user's specific label 241 # if any is known. 239 242 if ($label and $label eq 'WEB.UP') { 240 243 if ($labelForUser) { … … 245 248 246 249 # XXX: Think through when and if we change the product. 247 # if the product is the system default, set it to the product for the user@domain 250 # If the product is the system default, set it to the product for the user@domain. That way 251 # if the request came through a data store that target will be used. 252 # We really only need to redirect the results with greater access level than the default 248 253 if ($productIsDefault or $product eq 'NULL') { 249 254 if ($productForUser) { … … 251 256 } 252 257 } else { 258 # if we don't have a product use default 253 259 if ($product eq 'NULL') { 254 260 $product = $defaultDSProduct; 255 261 } 256 262 } 263 257 264 if (!$product or $product eq 'NULL') { 265 # this will only happen if the site.config variable is missing. 258 266 my_die("No product found.\n", $PS_EXIT_CONFIG_ERROR); 259 267 } 260 268 261 269 { 262 # update the database with the request name. This will be used as the263 # the fileset name in the output data store270 # update the request's row with the new parameters. 271 # The requset name will be used to set the output fileset name in the output data store. 264 272 my $command = "$pstamptool -updatereq -req_id $req_id -set_name $req_name"; 265 273 $command .= " -set_username $email" if $email ne 'null'; … … 277 285 } 278 286 287 if ($duplicate_req_name) { 288 exit 0; 289 } 290 279 291 if ($accessLevel < 0) { 280 292 exit 0; 281 293 } 282 294 283 if ($duplicate_req_name) {284 exit 0;285 }286 295 287 296 # … … 1288 1297 } 1289 1298 1290 my $have_access_tables = 1;1291 if ($have_access_tables) {1292 1293 1299 my $cmd = "$pstamptool -listuser -user $user -domain $domain"; 1294 1300 my $results = runToolAndParse($cmd, $verbose); 1295 1301 my $userinfo = $results->[0]; 1296 1302 if ($userinfo) { 1297 $level = $userinfo->{accessLevel Max};1303 $level = $userinfo->{accessLevel}; 1298 1304 if ($userinfo->{userProduct}) { 1299 1305 $$r_product = $userinfo->{userProduct}; … … 1311 1317 my $domaininfo = $results->[0]; 1312 1318 if ($domaininfo) { 1313 $level = $domaininfo->{accessLevel Max};1319 $level = $domaininfo->{accessLevel}; 1314 1320 if ($domaininfo->{defaultProduct}) { 1315 1321 $$r_product = $domaininfo->{defaultProduct}; … … 1325 1331 } 1326 1332 } 1327 } else { # XXX: delete this prototype before committing this file starting here1328 # !$have_access_tables1329 $domain = lc($domain);1330 if ($domain eq 'ifa.hawaii.edu' or $domain eq 'qub.ac.uk') {1331 $level = 2;1332 } else {1333 # access rights PS1 data only1334 $level = $defaultAccessLevel;1335 }1336 1337 if ($user eq 'bills' and $domain eq 'ifa.hawaii.edu') {1338 $$r_product = 'bills-results';1339 }1340 # XXX end of code to delete1341 1342 }1343 1333 1344 1334 return $level;
Note:
See TracChangeset
for help on using the changeset viewer.
