Changeset 2161
- Timestamp:
- Dec 9, 2013, 10:06:03 AM (10 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/ReggieRole.java
r2157 r2161 14 14 import net.sf.basedb.core.ItemQuery; 15 15 import net.sf.basedb.core.Nameable; 16 import net.sf.basedb.core.Permission; 17 import net.sf.basedb.core.PermissionDeniedException; 16 18 import net.sf.basedb.core.Role; 19 import net.sf.basedb.core.SystemItems; 17 20 import net.sf.basedb.core.Type; 21 import net.sf.basedb.core.User; 18 22 import net.sf.basedb.core.query.Expressions; 19 23 import net.sf.basedb.core.query.Hql; … … 90 94 } 91 95 96 /** 97 Check if the current user is a member of at least one of the given roles. 98 If {@link ReggieRole#ADMINISTRATOR} is in the list, the method also check 99 if the user is the ROOT user or not. If the user is not member of any 100 of the roles a PermissionDeniedException is thrown. 101 102 @param dc An active DbControl 103 @param message A message that is used if the user is not a member: 104 Permission denied: Not allowed to use <message> 105 @param roles A list with the roles to check 106 107 */ 108 public static void checkPermission(DbControl dc, String message, ReggieRole... roles) 109 { 110 for (ReggieRole role : roles) 111 { 112 if (role.isMember(dc)) return; 113 if (role == ReggieRole.ADMINISTRATOR) 114 { 115 boolean isRoot = dc.getSessionControl().getLoggedInUserId() == SystemItems.getId(User.ROOT); 116 if (isRoot) return; 117 } 118 } 119 throw new PermissionDeniedException(Permission.USE, message); 120 } 121 92 122 private final String name; 93 123 private final Item actualType; -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/BloodFollowUpRegistrationServlet.java
r2082 r2161 37 37 import net.sf.basedb.reggie.dao.Consent; 38 38 import net.sf.basedb.reggie.dao.Patient; 39 import net.sf.basedb.reggie.dao.ReggieRole; 39 40 import net.sf.basedb.reggie.dao.Subtype; 40 41 import net.sf.basedb.util.Values; … … 538 539 if ("CreateBlood".equals(cmd)) 539 540 { 541 dc = sc.newDbControl(); 542 543 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.PATIENT_CURATOR, ReggieRole.ADMINISTRATOR); 544 540 545 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 541 546 JSONObject jsonPat = (JSONObject)jsonReq.get("patientInfo"); 542 547 JSONObject jsonBlood = (JSONObject)jsonReq.get("bloodInfo"); 543 548 544 dc = sc.newDbControl();545 549 BioSource patient = getOrCreatePatient(dc, jsonPat, jsonMessages); 546 550 … … 592 596 else if ("UpdateBlood".equals(cmd)) 593 597 { 598 dc = sc.newDbControl(); 599 600 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.PATIENT_CURATOR, ReggieRole.ADMINISTRATOR); 601 594 602 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 595 603 JSONObject jsonBlood = (JSONObject)jsonReq.get("bloodInfo"); 596 dc = sc.newDbControl();597 604 598 605 Number bloodId = (Number)jsonBlood.get("id"); -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/BloodRegistrationServlet.java
r1788 r2161 28 28 import net.sf.basedb.reggie.dao.Consent; 29 29 import net.sf.basedb.reggie.dao.Patient; 30 import net.sf.basedb.reggie.dao.ReggieRole; 30 31 import net.sf.basedb.reggie.dao.Subtype; 31 32 import net.sf.basedb.util.Values; … … 184 185 if ("CreateBlood".equals(cmd)) 185 186 { 187 dc = sc.newDbControl(); 188 189 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.PATIENT_CURATOR, ReggieRole.ADMINISTRATOR); 190 186 191 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 187 192 JSONObject jsonPat = (JSONObject)jsonReq.get("patientInfo"); 188 193 JSONObject jsonBlood = (JSONObject)jsonReq.get("bloodInfo"); 189 194 190 dc = sc.newDbControl();191 195 BioSource patient = getOrCreatePatient(dc, jsonPat, jsonMessages); 192 196 … … 236 240 else if ("UpdateBlood".equals(cmd)) 237 241 { 242 dc = sc.newDbControl(); 243 244 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.PATIENT_CURATOR, ReggieRole.ADMINISTRATOR); 245 238 246 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 239 247 JSONObject jsonBlood = (JSONObject)jsonReq.get("bloodInfo"); 240 dc = sc.newDbControl();241 248 242 249 Number bloodId = (Number)jsonBlood.get("id"); -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/ConsentFormServlet.java
r1623 r2161 27 27 import net.sf.basedb.reggie.dao.Consent; 28 28 import net.sf.basedb.reggie.dao.Patient; 29 import net.sf.basedb.reggie.dao.ReggieRole; 29 30 import net.sf.basedb.reggie.dao.SpecimenTube; 30 31 import net.sf.basedb.reggie.dao.Subtype; … … 200 201 if ("RegisterConsent".equals(cmd)) 201 202 { 203 dc = sc.newDbControl(); 204 205 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.PATIENT_CURATOR, ReggieRole.ADMINISTRATOR); 206 202 207 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 203 208 JSONObject jsonConsent = (JSONObject)jsonReq.get("consentInfo"); 204 209 205 dc = sc.newDbControl();206 207 210 String caseName = (String)jsonConsent.get("caseName"); 208 211 String consent = Values.getStringOrNull((String)jsonConsent.get("consent")); -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/ExportServlet.java
r1958 r2161 32 32 import net.sf.basedb.reggie.Site; 33 33 import net.sf.basedb.reggie.dao.Annotationtype; 34 import net.sf.basedb.reggie.dao.ReggieRole; 34 35 import net.sf.basedb.reggie.dao.Subtype; 35 36 import net.sf.basedb.util.EqualsHelper; … … 62 63 if ("ExportMonthlyOpList".equals(cmd) || "ExportINCA".equals(cmd)) 63 64 { 65 dc = sc.newDbControl(); 66 67 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.PATIENT_CURATOR, ReggieRole.ADMINISTRATOR); 68 64 69 boolean exportSubtype = Values.getBoolean(req.getParameter("exportSubtype")); 65 70 boolean exportPatientId = Values.getBoolean(req.getParameter("exportPatientId")); … … 91 96 Date end = time.getTime(); 92 97 93 dc = sc.newDbControl();94 95 98 // Load sample items... 96 99 ItemQuery<Sample> specimenQuery = Sample.getQuery(); -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/ExtractionServlet.java
r2095 r2161 31 31 import net.sf.basedb.reggie.dao.Annotationtype; 32 32 import net.sf.basedb.reggie.dao.Lysate; 33 import net.sf.basedb.reggie.dao.ReggieRole; 33 34 import net.sf.basedb.reggie.dao.StoragePlate; 34 35 import net.sf.basedb.reggie.dao.Subtype; … … 228 229 { 229 230 dc = sc.newDbControl(); 231 232 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.SAMPLE_PREP, ReggieRole.ADMINISTRATOR); 230 233 231 234 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/FlowCellServlet.java
r2112 r2161 45 45 import net.sf.basedb.reggie.dao.PooledLibrary; 46 46 import net.sf.basedb.reggie.dao.ReactionPlate; 47 import net.sf.basedb.reggie.dao.ReggieRole; 47 48 import net.sf.basedb.reggie.dao.SequencingRun; 48 49 import net.sf.basedb.reggie.dao.Subtype; … … 260 261 if ("CreateFlowCells".equals(cmd)) 261 262 { 263 dc = sc.newDbControl(); 264 265 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.LIBRARY_PREP, ReggieRole.ADMINISTRATOR); 266 262 267 // Create FlowCells and add pools to them 263 268 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); … … 269 274 // Sequence string is concatenated: read1-index-read2 270 275 String sequencingCycles = read1 + "-" + indexRead + "-" + read2; 271 272 dc = sc.newDbControl(); 276 273 277 ItemSubtype flowCellType = Subtype.FLOW_CELL.load(dc); 274 278 ItemSubtype poolAliquotType = Subtype.POOLED_LIBRARY_ALIQUOT.load(dc); … … 357 361 else if ("RegisterFlowCells".equals(cmd)) 358 362 { 363 dc = sc.newDbControl(); 364 365 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.LIBRARY_PREP, ReggieRole.ADMINISTRATOR); 366 359 367 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 360 dc = sc.newDbControl();361 362 368 JSONArray jsonFlowCells = (JSONArray)jsonReq.get("flowCells"); 363 369 boolean failed = Boolean.TRUE.equals(jsonReq.get("failed")); -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/HistologyServlet.java
r2134 r2161 48 48 import net.sf.basedb.reggie.dao.Histology; 49 49 import net.sf.basedb.reggie.dao.ReactionPlate; 50 import net.sf.basedb.reggie.dao.ReggieRole; 50 51 import net.sf.basedb.reggie.dao.Subtype; 51 52 import net.sf.basedb.util.NameableComparator; … … 481 482 if ("CreateWorkList".equals(cmd)) 482 483 { 484 dc = sc.newDbControl(); 485 486 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.HISTOLOGY, ReggieRole.ADMINISTRATOR); 487 483 488 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 484 489 JSONArray jsonHistology = (JSONArray)jsonReq.get("histology"); 485 486 dc = sc.newDbControl(); 487 490 488 491 BioMaterialList workList = BioMaterialList.getNew(dc, Item.SAMPLE); 489 492 workList.setExternalId(Histology.WORK_LIST_ID_PREFIX); … … 529 532 else if ("MoveHistologySamplesToParaffinBlocks".equals(cmd)) 530 533 { 534 dc = sc.newDbControl(); 535 536 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.HISTOLOGY, ReggieRole.ADMINISTRATOR); 537 531 538 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 532 539 JSONArray jsonBlocks = (JSONArray)jsonReq.get("blocks"); … … 536 543 Number protocolId = (Number)jsonReq.get("protocolId"); 537 544 String storageBox = null; 538 539 dc = sc.newDbControl();540 545 541 546 BioMaterialList workList = BioMaterialList.getById(dc, workListId.intValue()); … … 635 640 else if ("RegisterHEGlass".equals(cmd)) 636 641 { 642 dc = sc.newDbControl(); 643 644 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.HISTOLOGY, ReggieRole.ADMINISTRATOR); 637 645 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 638 646 JSONObject jsonPlate = (JSONObject)jsonReq.get("paraffinBlock"); 639 647 JSONArray jsonWells = (JSONArray)jsonPlate.get("bioWells"); 640 648 JSONArray jsonHeGlass = (JSONArray)jsonPlate.get("heGlass"); 641 dc = sc.newDbControl();642 649 643 650 Number plateId = (Number)jsonPlate.get("id"); … … 776 783 else if ("SaveHeScore".equals(cmd)) 777 784 { 785 dc = sc.newDbControl(); 786 787 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.HISTOLOGY, ReggieRole.ADMINISTRATOR); 788 778 789 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 779 790 JSONArray jsonSamples = (JSONArray)jsonReq.get("samples"); 780 791 JSONArray jsonHeGlass = (JSONArray)jsonReq.get("heGlass"); 781 dc = sc.newDbControl();782 792 783 793 // Update scores on samples -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/LibPrepServlet.java
r2002 r2161 3 3 import java.io.IOException; 4 4 import java.io.Writer; 5 6 5 import java.text.SimpleDateFormat; 7 6 import java.util.Date; … … 19 18 import org.json.simple.JSONObject; 20 19 import org.json.simple.parser.JSONParser; 20 21 21 22 22 … … 61 61 import net.sf.basedb.reggie.dao.Library; 62 62 import net.sf.basedb.reggie.dao.ReactionPlate; 63 import net.sf.basedb.reggie.dao.ReggieRole; 63 64 import net.sf.basedb.reggie.dao.Rna; 64 65 import net.sf.basedb.reggie.dao.Subtype; … … 397 398 if ("CreateBarcodedLibraries".equals(cmd)) 398 399 { 400 dc = sc.newDbControl(); 401 402 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.LIBRARY_PREP, ReggieRole.ADMINISTRATOR); 403 399 404 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 400 405 JSONObject jsonPlate = (JSONObject)jsonReq.get("bioplate"); 401 406 JSONArray jsonWells = (JSONArray)jsonPlate.get("wells"); 402 403 dc = sc.newDbControl();404 407 405 408 // Load the CDNA bioplate and store comments and annotations … … 486 489 else if ("ImportLibPrepQcResults".equals(cmd)) 487 490 { 491 dc = sc.newDbControl(); 492 493 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.LIBRARY_PREP, ReggieRole.ADMINISTRATOR); 494 488 495 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 489 496 Number bioPlateId = (Number)jsonReq.get("bioplate"); 490 497 Number pdfId = (Number)jsonReq.get("qcPdf"); 491 498 Date qcDate = Reggie.CONVERTER_STRING_TO_DATE.convert((String)jsonReq.get("qcDate")); 492 493 dc = sc.newDbControl(); 494 499 495 500 BioPlate libPlate = BioPlate.getById(dc, bioPlateId.intValue()); 496 501 … … 514 519 else if ("ImportLibPrepResults".equals(cmd)) 515 520 { 521 dc = sc.newDbControl(); 522 523 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.LIBRARY_PREP, ReggieRole.ADMINISTRATOR); 524 516 525 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 517 526 Number bioPlateId = (Number)jsonReq.get("bioplate"); … … 524 533 Number pdfId = (Number)jsonReq.get("caliperPdf"); 525 534 526 dc = sc.newDbControl();527 535 BioPlate libPlate = BioPlate.getById(dc, bioPlateId.intValue()); 528 536 -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/MRnaServlet.java
r2143 r2161 52 52 import net.sf.basedb.reggie.dao.MRna; 53 53 import net.sf.basedb.reggie.dao.ReactionPlate; 54 import net.sf.basedb.reggie.dao.ReggieRole; 54 55 import net.sf.basedb.reggie.dao.Rna; 55 56 import net.sf.basedb.reggie.dao.Subtype; … … 452 453 else if ("CreateMRnaPlate".equals(cmd)) 453 454 { 455 dc = sc.newDbControl(); 456 457 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.LIBRARY_PLATE_DESIGNER, ReggieRole.ADMINISTRATOR); 458 454 459 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 455 460 JSONObject jsonPlate = (JSONObject)jsonReq.get("bioplate"); … … 458 463 String plateName = (String)jsonPlate.get("name"); 459 464 JSONArray jsonWells = (JSONArray)jsonPlate.get("wells"); 460 461 dc = sc.newDbControl(); 462 465 463 466 PlateGeometry geometry = BioplateType.MRNA.getPlateGeometry(dc); 464 467 BioPlateType plateType = BioplateType.MRNA.load(dc); … … 556 559 else if ("ImportMRnaQCResults".equals(cmd)) 557 560 { 561 dc = sc.newDbControl(); 562 563 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.LIBRARY_PREP, ReggieRole.ADMINISTRATOR); 564 558 565 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 559 566 … … 563 570 boolean failed = Boolean.TRUE.equals(jsonReq.get("failed")); 564 571 565 dc = sc.newDbControl();566 567 572 // Load mRNA plate and the creation event 568 573 ReactionPlate mrnaReactionPlate = ReactionPlate.getById(dc, bioPlateId.intValue(), BioplateType.MRNA); … … 701 706 else if ("ImportCDnaResults".equals(cmd)) 702 707 { 708 dc = sc.newDbControl(); 709 710 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.LIBRARY_PREP, ReggieRole.ADMINISTRATOR); 711 703 712 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 704 713 … … 707 716 boolean failed = Boolean.TRUE.equals(jsonReq.get("failed")); 708 717 709 dc = sc.newDbControl();710 711 718 // Load cDNA plate and the creation event 712 719 ReactionPlate cdnaReactionPlate = ReactionPlate.getById(dc, bioPlateId.intValue(), BioplateType.CDNA); -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/PartitionRegistrationServlet.java
r1983 r2161 29 29 import net.sf.basedb.reggie.converter.StringToDateConverter; 30 30 import net.sf.basedb.reggie.dao.Annotationtype; 31 import net.sf.basedb.reggie.dao.ReggieRole; 31 32 import net.sf.basedb.reggie.dao.SpecimenTube; 32 33 import net.sf.basedb.reggie.dao.Subtype; … … 166 167 { 167 168 dc = sc.newDbControl(); 169 170 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.SAMPLE_PREP, ReggieRole.ADMINISTRATOR); 171 168 172 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 169 173 JSONObject jsonInfo = (JSONObject)jsonReq.get("tubeInfo"); -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/PersonalRegistrationServlet.java
r2037 r2161 38 38 import net.sf.basedb.reggie.dao.NoSpecimen; 39 39 import net.sf.basedb.reggie.dao.Patient; 40 import net.sf.basedb.reggie.dao.ReggieRole; 40 41 import net.sf.basedb.reggie.dao.SpecimenTube; 41 42 import net.sf.basedb.reggie.dao.Subtype; … … 323 324 if ("CreateCase".equals(cmd)) 324 325 { 326 dc = sc.newDbControl(); 327 328 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.PATIENT_CURATOR, ReggieRole.ADMINISTRATOR); 329 325 330 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 326 331 JSONObject jsonPat = (JSONObject)jsonReq.get("patientInfo"); 327 332 JSONObject jsonCase = (JSONObject)jsonReq.get("caseInfo"); 328 333 329 dc = sc.newDbControl();330 334 BioSource patient = getOrCreatePatient(dc, jsonPat, jsonMessages); 331 335 … … 460 464 else if ("UpdateCase".equals(cmd)) 461 465 { 466 dc = sc.newDbControl(); 467 468 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.PATIENT_CURATOR, ReggieRole.ADMINISTRATOR); 469 462 470 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 463 471 JSONObject jsonCase = (JSONObject)jsonReq.get("caseInfo"); 464 472 JSONObject jsonPat = (JSONObject)jsonReq.get("patientInfo"); 465 dc = sc.newDbControl();466 473 467 474 BioSource patient = getOrCreatePatient(dc, jsonPat, jsonMessages); -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/PoolServlet.java
r2141 r2161 14 14 import org.json.simple.JSONObject; 15 15 import org.json.simple.parser.JSONParser; 16 16 17 17 18 … … 47 48 import net.sf.basedb.reggie.dao.PooledLibrary; 48 49 import net.sf.basedb.reggie.dao.ReactionPlate; 50 import net.sf.basedb.reggie.dao.ReggieRole; 49 51 import net.sf.basedb.reggie.dao.Rna; 50 52 import net.sf.basedb.reggie.dao.Subtype; … … 374 376 if ("CreatePools".equals(cmd)) 375 377 { 378 dc = sc.newDbControl(); 379 380 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.LIBRARY_PREP, ReggieRole.ADMINISTRATOR); 381 376 382 // Create PooledLibrary items from a Library bioplate 377 383 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); … … 382 388 String mixingStrategy = (String)jsonReq.get("mixingStrategy"); 383 389 384 dc = sc.newDbControl();385 390 ItemSubtype pooledLibraryType = Subtype.POOLED_LIBRARY.load(dc); 386 391 ItemSubtype libraryType = Subtype.LIBRARY.load(dc); … … 559 564 else if ("RegisterPooledLibraries".equals(cmd)) 560 565 { 566 dc = sc.newDbControl(); 567 568 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.LIBRARY_PREP, ReggieRole.ADMINISTRATOR); 569 561 570 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 562 dc = sc.newDbControl();563 571 564 572 Number poolProtocolId = (Number)jsonReq.get("poolProtocol"); -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/RnaQcServlet.java
r1983 r2161 46 46 import net.sf.basedb.reggie.dao.BioplateType; 47 47 import net.sf.basedb.reggie.dao.ReactionPlate; 48 import net.sf.basedb.reggie.dao.ReggieRole; 48 49 import net.sf.basedb.reggie.dao.Rna; 49 50 import net.sf.basedb.reggie.dao.Subtype; … … 324 325 if ("PlaceRnaQcAliquots".equals(cmd)) 325 326 { 327 dc = sc.newDbControl(); 328 329 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.SAMPLE_PREP, ReggieRole.ADMINISTRATOR); 330 326 331 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 327 332 JSONArray jsonRnaQcExtracts = (JSONArray)jsonReq.get("rnaQcExtracts"); 328 333 JSONObject jsonPlate = (JSONObject)jsonReq.get("bioplate"); 329 334 JSONObject jsonProtocol = (JSONObject)jsonReq.get("protocol"); 330 331 dc = sc.newDbControl(); 332 335 333 336 AnnotationType qcHiSenseType = Annotationtype.QC_HISENSE.load(dc); 334 337 … … 448 451 else if ("ImportCaliperResults".equals(cmd)) 449 452 { 453 dc = sc.newDbControl(); 454 455 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.SAMPLE_PREP, ReggieRole.ADMINISTRATOR); 456 450 457 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 451 458 … … 455 462 Number pdfId = (Number)jsonReq.get("pdf"); 456 463 457 dc = sc.newDbControl();458 464 AnnotationType rqs = Annotationtype.CA_RQS.load(dc); 459 465 -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/SpecimenTubeServlet.java
r2159 r2161 30 30 import net.sf.basedb.reggie.dao.Case; 31 31 import net.sf.basedb.reggie.dao.NoSpecimen; 32 import net.sf.basedb.reggie.dao.ReggieRole; 32 33 import net.sf.basedb.reggie.dao.SpecimenTube; 33 34 import net.sf.basedb.reggie.dao.Subtype; … … 259 260 final SessionControl sc = Application.getSessionControl(ID, req.getRemoteAddr()); 260 261 DbControl dc = null; 261 262 262 263 try 263 264 { … … 265 266 { 266 267 dc = sc.newDbControl(); 268 269 ReggieRole.checkPermission(dc, "'" + cmd + "' wizard", ReggieRole.SAMPLE_PREP, ReggieRole.ADMINISTRATOR); 270 267 271 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 268 272 JSONObject jsonCase = (JSONObject)jsonReq.get("caseInfo");
Note: See TracChangeset
for help on using the changeset viewer.