diff --git a/SQL/0000-00-02-Permission.sql b/SQL/0000-00-02-Permission.sql index 5057a519f90..c5bd8671a91 100644 --- a/SQL/0000-00-02-Permission.sql +++ b/SQL/0000-00-02-Permission.sql @@ -136,7 +136,8 @@ INSERT INTO `permissions` VALUES (64,'dataquery_admin','Admin dataquery queries',(SELECT ID FROM modules WHERE Name='dataquery'),NULL,'2'), (65,'schedule_module','Schedule Module - edit and delete the appointment',(SELECT ID FROM modules WHERE Name='schedule_module'),'View/Create/Edit','2'), (66,'document_repository_categories','Categories',(SELECT ID FROM modules WHERE Name='document_repository'), 'Edit/Upload/Delete', '2'), - (67,'document_repository_hidden','Restricted files',(SELECT ID FROM modules WHERE Name='document_repository'), 'View', '2'); + (67,'document_repository_hidden','Restricted files',(SELECT ID FROM modules WHERE Name='document_repository'), 'View', '2'), + (68,'imaging_uploader_nosessionid', 'uploads with no session ID', (SELECT ID FROM modules WHERE Name='imaging_uploader'), 'View', 2); INSERT INTO `user_perm_rel` (userID, permID) SELECT u.ID, p.permID diff --git a/SQL/0000-00-03-ConfigTables.sql b/SQL/0000-00-03-ConfigTables.sql index 83b460343a9..591e323e60e 100644 --- a/SQL/0000-00-03-ConfigTables.sql +++ b/SQL/0000-00-03-ConfigTables.sql @@ -97,8 +97,9 @@ INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'LegoPhantomRegex', 'Regex for identifying a Lego Phantom scan header', 1, 0, 'text', ID, 'Lego phantom regex', 3 FROM ConfigSettings WHERE Name="imaging_modules"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'LivingPhantomRegex', 'Regex to be used on Living Phantom scan header', 1, 0, 'text', ID, 'Living phantom regex', 4 FROM ConfigSettings WHERE Name="imaging_modules"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'showTransferStatus', 'Show transfer status in the DICOM Archive table', 1, 0, 'boolean', ID, 'Show transfer status', 5 FROM ConfigSettings WHERE Name="imaging_modules"; -INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'tblScanTypes', 'Scan types from the mri_scan_type table that the project wants to see displayed in Imaging Browser table', 1, 1, 'scan_type', ID, 'Imaging Browser Tabulated Scan Types', 6 FROM ConfigSettings WHERE Name="imaging_modules"; -INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'ImagingBrowserLinkedInstruments', 'Instruments that the users want to see linked from Imaging Browser', 1, 1, 'instrument', ID, 'Imaging Browser Links to Instruments', 7 FROM ConfigSettings WHERE Name="imaging_modules"; +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'useSiteProjectPermissions', 'Only allow users access to data with a sessionID (for site and project access restrictions). Bypassed by each module `nosessionid` permission for admins', 1, 0, 'boolean', ID, 'Use Site Project Permissions', 6 FROM ConfigSettings WHERE Name='imaging_modules'; +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'tblScanTypes', 'Scan types from the mri_scan_type table that the project wants to see displayed in Imaging Browser table', 1, 1, 'scan_type', ID, 'Imaging Browser Tabulated Scan Types', 7 FROM ConfigSettings WHERE Name="imaging_modules"; +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'ImagingBrowserLinkedInstruments', 'Instruments that the users want to see linked from Imaging Browser', 1, 1, 'instrument', ID, 'Imaging Browser Links to Instruments', 8 FROM ConfigSettings WHERE Name="imaging_modules"; INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, Label, OrderNumber) VALUES ('statistics', 'Statistics module settings', 1, 0, 'Statistics', 7); @@ -232,6 +233,7 @@ INSERT INTO Config (ConfigID, Value) SELECT ID, "." FROM ConfigSettings WHERE Na INSERT INTO Config (ConfigID, Value) SELECT ID, "(?i)phantom" FROM ConfigSettings WHERE Name="LegoPhantomRegex"; INSERT INTO Config (ConfigID, Value) SELECT ID, "(?i)phantom" FROM ConfigSettings WHERE Name="LivingPhantomRegex"; INSERT INTO Config (ConfigID, Value) SELECT ID, "false" FROM ConfigSettings WHERE Name="showTransferStatus"; +INSERT INTO Config (ConfigID, Value) SELECT ID, "false" FROM ConfigSettings WHERE Name="useSiteProjectPermissions"; INSERT INTO Config (ConfigID, Value) SELECT cs.ID, GROUP_CONCAT(mst.MriScanTypeName) FROM ConfigSettings cs JOIN mri_scan_type mst WHERE cs.Name="tblScanTypes" AND mst.MriScanTypeID=44; INSERT INTO Config (ConfigID, Value) SELECT cs.ID, GROUP_CONCAT(mst.MriScanTypeName) FROM ConfigSettings cs JOIN mri_scan_type mst WHERE cs.Name="tblScanTypes" AND mst.MriScanTypeID=45; INSERT INTO Config (ConfigID, Value) SELECT cs.ID, "mri_parameter_form" FROM ConfigSettings cs WHERE cs.Name="ImagingBrowserLinkedInstruments"; diff --git a/SQL/New_patches/2025-01-15-Imaging_modules_site_project_permissions.sql b/SQL/New_patches/2025-01-15-Imaging_modules_site_project_permissions.sql new file mode 100644 index 00000000000..57ff7bf6a19 --- /dev/null +++ b/SQL/New_patches/2025-01-15-Imaging_modules_site_project_permissions.sql @@ -0,0 +1,5 @@ +INSERT INTO permissions (code, description, moduleID, `action`, categoryID) +SELECT 'imaging_uploader_nosessionid', 'uploads with no session ID', ID, 'View', 2 FROM modules WHERE Name='imaging_uploader'; + +INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) +SELECT 'useSiteProjectPermissions', 'Only allow users access to data with a sessionID (for site and project access restrictions). Bypassed by module `nosessionid` permissions for admins', 1, 0, 'boolean', ID, 'Use Site Project Permissions', 6 FROM ConfigSettings WHERE Name='imaging_modules'; diff --git a/modules/imaging_uploader/README.md b/modules/imaging_uploader/README.md index 87aaf413591..bccf4784e40 100644 --- a/modules/imaging_uploader/README.md +++ b/modules/imaging_uploader/README.md @@ -53,10 +53,16 @@ For a successful upload: #### Module Permission -The imaging uploader module uses one permission called `imaging_uploader` that +The imaging uploader module uses the permission called `imaging_uploader` that is necessary to have access to the module and gives the user the ability to upload and browse all scans uploaded to the database. +The `imaging_uploader_nosessionid` (Imaging Uploader: View uploads with no session ID) +allows to partially bypass the `useSiteProjectPermissions` configuration (see Configurations +section below) to see all uploads not associated to a site or project (no session +ID found on upload) + + #### Filesystem Permission The path on the filesystem where the uploaded file go @@ -93,6 +99,15 @@ MRIUploadIncomingPath - This setting determines where on the filesystem the `MRIUploadIncomingPath`following a successful archival and insertion through the LORIS-MRI pipeline. +useSiteProjectPermissions - This setting enables Site and Project access restrictions + for users. If enabled, users accessing the module can only see uploads where a + session ID has been found and are thus linked to the site and project of the + session AND the site and project match the user's. Users can also see any file + they have uploaded themselves regardless of if a sesssion ID has been found. + This setting can be PARTIALLY bypassed by the `imaging_uploader_nosessionid` + permission (partially only because the permission will also append any upload + with no site or project) + ## Interactions with LORIS diff --git a/modules/imaging_uploader/php/imaging_uploader.class.inc b/modules/imaging_uploader/php/imaging_uploader.class.inc index d86ab8ac27e..88b5b76a0e2 100644 --- a/modules/imaging_uploader/php/imaging_uploader.class.inc +++ b/modules/imaging_uploader/php/imaging_uploader.class.inc @@ -58,6 +58,41 @@ class Imaging_Uploader extends \NDB_Menu_Filter_Form */ function _setupVariables() { + $config = \NDB_Factory::singleton()->config(); + $siteprojectperms = $config->getSetting( + 'useSiteProjectPermissions' + ); + + $where = ''; + if ($siteprojectperms === 'true') { + // If config setting is enabled, check the user's sites and projects + // and add the WHERE clause to exclude any records that the user does + // not have access to. UNLESS user has 'imaging_uploader_nosessionid' + $user = \NDB_Factory::singleton()->user(); + $centerString = implode("','", $user->getCenterIDs()); + $projectString = implode("','", $user->getProjectIDs()); + $username = $user->getUsername(); + + if ($user->hasPermission('imaging_uploader_nosessionid')) { + // site/project match + null sites and projects + user's own uploads + $where = " WHERE + (s.CenterID IN ('$centerString') + AND + s.ProjectID IN ('$projectString') + ) OR mu.UploadedBy='$username' + OR s.CenterID IS NULL + OR s.ProjectID IS NULL"; + + } else { + // site/project match + user's own uploads + $where = " WHERE + (s.CenterID IN ('$centerString') + AND + s.ProjectID IN ('$projectString') + ) OR mu.UploadedBy='$username'"; + } + } + $this->_resetFilters(); $progressSelectPart = "IF(ISNULL(Inserting), 'Not Started'," . "IF(Inserting=1, 'In Progress...', " @@ -84,12 +119,14 @@ class Imaging_Uploader extends \NDB_Menu_Filter_Form 's.Visit_label', 'mu.IsPhantom', ]; - $this->query = " FROM mri_upload mu LEFT JOIN session". - " s ON (s.ID = mu.SessionID)". + $this->query = " FROM mri_upload mu". + " LEFT JOIN session s ON (s.ID = mu.SessionID)". " LEFT JOIN candidate c ON (c.CandID = s.CandID)". " LEFT JOIN tarchive ta ON". - " (mu.TarchiveID = ta.TarchiveID)". - " WHERE 1=1 "; + " (mu.TarchiveID = ta.TarchiveID)"; + if ($siteprojectperms === 'true') { + $this->query .= $where; + } $this->formToFilter = [ 'CandID' => 's.CandID', 'PSCID' => 'c.PSCID', diff --git a/modules/imaging_uploader/test/TestPlan.md b/modules/imaging_uploader/test/TestPlan.md index dd83191c38e..107cb039ca7 100644 --- a/modules/imaging_uploader/test/TestPlan.md +++ b/modules/imaging_uploader/test/TestPlan.md @@ -4,67 +4,86 @@ [Automation Testing] 2. Ensure that upon loading, the Imaging Uploader page has the 'Browse' and 'Upload' tabs. [Manual Testing] -3. Check that when accessing the Imaging Uploader page, the 'Browse' tab displays all the uploads done for all users. +3. Set the `useSiteProjectPermissions` (Use Site Project Permissions) Configuration to NO and make sure your + user does NOT have the `imaging_uploader_nosessionid` permission (do not use superuser) + [Manual Testing] +4. Check that when accessing the Imaging Uploader page, the 'Browse' tab displays all the uploads done for all users. [Automation Testing] -4. Ensure that the Browse tab allows searching based on CandID, PSCID, and/or Visit Label. Ensure that the Visit Label - is a dropdown menu containing all the possible visit labels (taken from the Visit_label column in the session table - for any Active candidate), and ensure that the CandID and PSCID automatically filter the list of entries in Imaging - Uploader table on the 'fly', as fields are being filled out. Ensure that this works no matter what page of results - from the query to the uploads table you are currently on. Ensure that 'Clear Filters' button works. - [Manual Testing] -5. Ensure that the 'Upload' tab has the CandID, PSCID, and Visit Label greyed out. These greyed out fields remain - empty if the 'Phantom Scans' is set to Yes, and are properly filled based on the uploaded filename if 'Phantom Scans' is set to No. +5. Change the `useSiteProjectPermissions` (Use Site Project Permissions) Configuration to YES and make sure your + user does NOT have the `imaging_uploader_nosessionid` permission (do not use superuser) + [Manual Testing] +6. Check that when accessing the Imaging Uploader page, the 'Browse' tab displays all the uploads done where + the upload's associated session ID matches the user's sites and projects. + [Manual Testing] +7. Check that when accessing the Imaging Uploader page, the 'Browse' tab displays all the uploads done by the logged in user. + [Manual Testing] +8. keep the `useSiteProjectPermissions` (Use Site Project Permissions) Configuration to YES and make sure your + user HAS the `imaging_uploader_nosessionid` permission (do not use superuser) [Manual Testing] -6. Test validation errors for 'CandID', 'PSCID', and 'Visit Label' in the 'Upload' tab and ensure that the appropriate - error messages are displayed under the relevant form elements. +9. Check that the user still has access to uploads decribed in #6 and #7 + [Manual Testing] +10. Check that when accessing the Imaging Uploader page, the 'Browse' tab displays all the uploads that + do not have an associated sessionID and thus no site or project. + [Manual Testing] +11. Ensure that the Browse tab allows searching based on CandID, PSCID, and/or Visit Label. Ensure that the Visit Label + is a dropdown menu containing all the possible visit labels (taken from the Visit_label column in the session table + for any Active candidate), and ensure that the CandID and PSCID automatically filter the list of entries in Imaging + Uploader table on the 'fly', as fields are being filled out. Ensure that this works no matter what page of results + from the query to the uploads table you are currently on. Ensure that 'Clear Filters' button works. + [Manual Testing] +12. Ensure that the 'Upload' tab has the CandID, PSCID, and Visit Label greyed out. These greyed out fields remain + empty if the 'Phantom Scans' is set to Yes, and are properly filled based on the uploaded filename if 'Phantom Scans' is set to No. + [Manual Testing] +13. Test validation errors for 'CandID', 'PSCID', and 'Visit Label' in the 'Upload' tab and ensure that the appropriate + error messages are displayed under the relevant form elements. - Set Phantom Scans to 'No' and try to upload a valid `.zip` file for each scenario below: - - A `CandID` that does not exist in the `candidate` table (e.g. try appending letters to an existing `CandID`) - - A `PSCID` that is invalid for a specific `CandID` in the `candidate` table - - A `Visit_label` that is invalid for a specific `CandID` in the `session` table - - A candidate that has `Active` set to 'N' in the `candidate` table - - A session that has `Active` set to 'N' in the `session` table - - You should also consider scenarios where there are a combination of these errors or no error at all + Set Phantom Scans to 'No' and try to upload a valid `.zip` file for each scenario below: + - A `CandID` that does not exist in the `candidate` table (e.g. try appending letters to an existing `CandID`) + - A `PSCID` that is invalid for a specific `CandID` in the `candidate` table + - A `Visit_label` that is invalid for a specific `CandID` in the `session` table + - A candidate that has `Active` set to 'N' in the `candidate` table + - A session that has `Active` set to 'N' in the `session` table + - You should also consider scenarios where there are a combination of these errors or no error at all - _e.g. SQL command to set candidate associated with CandID X as inactive:_ + _e.g. SQL command to set candidate associated with CandID X as inactive:_ - `UPDATE candidate SET Active = 'N' WHERE CandID = X;` + `UPDATE candidate SET Active = 'N' WHERE CandID = X;` - _e.g. SQL command to set session associated with CandID X and Visit Label Y as inactive:_ + _e.g. SQL command to set session associated with CandID X and Visit Label Y as inactive:_ - `UPDATE session SET Active = 'N' WHERE CandID = X AND Visit_label = 'Y';` + `UPDATE session SET Active = 'N' WHERE CandID = X AND Visit_label = 'Y';` - [Manual Testing] + [Manual Testing] -7. Test validations for 'File to Upload' in the 'Upload' tab and ensure that the appropriate - error messages are displayed under the 'File to Upload' element. +14. Test validations for 'File to Upload' in the 'Upload' tab and ensure that the appropriate + error messages are displayed under the 'File to Upload' element. - Set Phantom Scans to 'Yes' and try to upload a file for each scenario below: - - A file that is not of type `.tgz` or `tar.gz` or `.zip` (e.g. a `.jpg` or `.txt`) - - A file that exceeds the max upload size + Set Phantom Scans to 'Yes' and try to upload a file for each scenario below: + - A file that is not of type `.tgz` or `tar.gz` or `.zip` (e.g. a `.jpg` or `.txt`) + - A file that exceeds the max upload size - Set Phantom Scans to 'No' and try to upload a file for each scenario below: - - A file that is not of type `.tgz` or `tar.gz` or `.zip` (e.g. a `.jpg` or `.txt`) - - A file that exceeds the max upload size - - A file that that does not match the `PSCID_CandID_VisitLabel` convention + Set Phantom Scans to 'No' and try to upload a file for each scenario below: + - A file that is not of type `.tgz` or `tar.gz` or `.zip` (e.g. a `.jpg` or `.txt`) + - A file that exceeds the max upload size + - A file that that does not match the `PSCID_CandID_VisitLabel` convention - [Manual Testing] + [Manual Testing] -8. Once all the values in the form have been validated, ensure that you can upload a `.zip` file and a `.tgz` file - [Manual Testing] -9. Upload a scan which was already uploaded and which has either 'Not Started' or 'Failure' status in the Progress column. - Ensure the file exists in the location specified in the Upload Location column. - Ensure you get the Warning message 'Are you sure? A file with this name already exists! Would you like to override - existing file?'. Ensure the correct behaviour of the two possible actions by the user: 'Yes, I am sure!' or 'No, cancel it!'. - [Manual Testing] -10. Upload a scan which was already uploaded and which was processed with 'Success' status in the Progress column. - Ensure you can not re-upload the file, and get the Error message 'File already exists! A file with this name has already - successfully passed the MRI pipeline!'. - [Manual Testing] -11. Upload a new, valid, anonymized `.tar.gz` DICOM archive with the correct CandID, PSCID and visit label. Verify that the +15. Once all the values in the form have been validated, ensure that you can upload a `.zip` file and a `.tgz` file + [Manual Testing] +16. Upload a scan which was already uploaded and which has either 'Not Started' or 'Failure' status in the Progress column. + Ensure the file exists in the location specified in the Upload Location column. + Ensure you get the Warning message 'Are you sure? A file with this name already exists! Would you like to override + existing file?'. Ensure the correct behaviour of the two possible actions by the user: 'Yes, I am sure!' or 'No, cancel it!'. + [Manual Testing] +17. Upload a scan which was already uploaded and which was processed with 'Success' status in the Progress column. + Ensure you can not re-upload the file, and get the Error message 'File already exists! A file with this name has already + successfully passed the MRI pipeline!'. + [Manual Testing] +18. Upload a new, valid, anonymized `.tar.gz` DICOM archive with the correct CandID, PSCID and visit label. Verify that the file appears in the table after loading is complete. [Manual Testing] -12. In the Study section of the Admin/Configuration module, `Study` tab, ensure the 'ImagingUploader Auto launch' option is set to 'No'. +19. In the Study section of the Admin/Configuration module, `Study` tab, ensure the 'ImagingUploader Auto launch' option is set to 'No'. Click on the show-data button and check the contents of the upload table after the successful upload done in 8. Ensure that the Progress column entry for that UploadID displays 'Not Started'. Launch the imaging insertion scripts from a terminal window. Ensure the Progress column entry for that UploadID displays @@ -79,39 +98,39 @@ the Number Of MincCreated and Number Of MincInserted columns, then check that the Number Of MincCreated column has a clickable link that takes the user to the MRI violations page, displaying the violated scans of this upload. [Manual Testing] -13. Go to the Candidate Profile page and search for the CandID of the candidate to which the scan belongs. Click on the +20. Go to the Candidate Profile page and search for the CandID of the candidate to which the scan belongs. Click on the `View Imaging datasets` button and verify that it takes you to the Imaging Browser page with all the valid scans for this candidate loaded in the result table. [Manual Testing] -14. Go in the profile details for the candidate found in step 13 and go into the visit table. Ensure that column +21. Go in the profile details for the candidate found in step 20 and go into the visit table. Ensure that column `MR Scan Done` is set to `Y`. Click on the `View Imaging data` button at the bottom of the page and verify that it takes you to the Imaging Browser page with the valid scans performed for that candidate at that visit loaded in the result table. [Manual Testing] -15. Go the the Imaging Uploader page and search for the upload done in step 11 using (in turn) the CandID, PSCID and - visit label. Verify that the upload done in step 11 is shown in the table each time. +22. Go the the Imaging Uploader page and search for the upload done in step 18 using (in turn) the CandID, PSCID and + visit label. Verify that the upload done in step 18 is shown in the table each time. [Manual Testing] -16. Repeat steps 11-15 but with a `.tgz` and `.zip` file. +23. Repeat steps 18-22 but with a `.tgz` and `.zip` file. [Manual Testing] -17. In the Admin/Configuration module, set the 'ImagingUploader Auto launch' option to 'Yes'. - Repeat steps 11-16 to verify that the insertion scripts work with the Auto Launch option. +24. In the Admin/Configuration module, set the 'ImagingUploader Auto launch' option to 'Yes'. + Repeat steps 18-23 to verify that the insertion scripts work with the Auto Launch option. [Manual Testing] -18. Upload a valid, anonymized `.tar.gz` DICOM archive but with a patient name (PSCID, CandID, Visit label) that does not +25. Upload a valid, anonymized `.tar.gz` DICOM archive but with a patient name (PSCID, CandID, Visit label) that does not match the one stored in the DICOM files of the archive (for example, patient name DICOM header = `MTL0001_111111_V01` but `.tar.gz` name being `MTL0002_222222_V01` which corresponds to another valid candidate). Check that an appropriate message is written in the Log Viewer UI bloc (i.e. "`The PatientName read from the DICOM header does not start with MTL0002_222222_V01 from the mri_upload table`"). [Manual Testing] -19. Set the config setting 'ImagingUploader auto launch' to 'Yes'. Then, edit your prod file (in +26. Set the config setting 'ImagingUploader auto launch' to 'Yes'. Then, edit your prod file (in `/dicom-archive/.loris-mri`) and comment out the definition of the @db array. Once these operations are done, upload any valid scan: check in the server processes manager that this fails with an error code of 4. Now try to upload the scan again. When the system asks you if you want to overwrite the existing archive, answer 'Yes'. Check that this reupload fails with error code 4 (and not 2). Related to Redmine#14093 and PR#3555. [Manual Testing] -20. Set the config setting 'ImagingUploader auto launch' to 'No'. Upload an MRI archive that can successfully be +27. Set the config setting 'ImagingUploader auto launch' to 'No'. Upload an MRI archive that can successfully be uploaded. Check that the value of the Progress column for the uploaded archive is 'Not started'. [Manual Testing] -21. Set the config setting 'ImagingUploader auto launch' to 'Yes'. Upload an MRI archive that can successfully be +28. Set the config setting 'ImagingUploader auto launch' to 'Yes'. Upload an MRI archive that can successfully be uploaded and that will be processed successfully by the pipeline. Once the upload is finished and processing of the archive has begun, check that the value of the Progress column for the uploaded archive is 'In Progress...'. Click on the uploaded archive in the results table and select 'Detailed' in the combo box of the log panel. Check that an @@ -120,14 +139,14 @@ 'Success (X out of Y)', where X is the number of MINC files successfully inserted and Y is the total number of MINC files created. [Manual Testing] -22. Set the config setting 'ImagingUploader auto launch' to 'Yes'. Upload a file that can successfully be uploaded but that +29. Set the config setting 'ImagingUploader auto launch' to 'Yes'. Upload a file that can successfully be uploaded but that will fail the processing done by the MRI pipeline. After the upload succeeds, wait for the MRI pipeline to finish processing the archive and check that the Progress column is set to 'Failure'. Note down the text that is displayed in the log panel (Detailed view). Now change the config setting 'ImagingUploader auto launch' to 'No'. Upload the same file again. once the upload is finished, ensure that the detailed log messages seen earlier are gone and have been replaced by a message that indicates that processing of the archive has not begun yet. [Manual Testing] -23. Set the config setting 'ImagingUploader auto launch' to 'Yes'. Change config setting MRICodePath so that its value is set to +30. Set the config setting 'ImagingUploader auto launch' to 'Yes'. Change config setting MRICodePath so that its value is set to a directory that does not exist. Upload an MRI archive that can successfully be uploaded. Once the upload is done, check that the value in the 'Progress' column for this scan is set to 'Failure'. Also check that a message in the log panel indicate that there is something wrong with the setup of the LORIS-MRI code base. diff --git a/raisinbread/RB_files/RB_ConfigSettings.sql b/raisinbread/RB_files/RB_ConfigSettings.sql index 6e5137f91f3..10d6632bac1 100644 --- a/raisinbread/RB_files/RB_ConfigSettings.sql +++ b/raisinbread/RB_files/RB_ConfigSettings.sql @@ -112,8 +112,7 @@ INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMult INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (122,'AWS_S3_Endpoint','Endpoint to use for accessing files stored in S3. Endpoint or region are required for S3 support.',1,0,'text',121,'AWS S3 Endpoint',3); INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (123,'AWS_S3_Region','AWS Region to use for accessing files stored in S3. Endpoint or region are required for S3 support.',1,0,'text',121,'AWS S3 Region',3); INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (124,'AWS_S3_Default_Bucket','Default bucket for LORIS to use for accessing files in S3.',1,0,'text',121,'AWS S3 Default Bucket',3); -INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES -(125,'useEEGBrowserVisualizationComponents','Whether to enable the visualization components on the EEG Browser module',1,0,'boolean',39,'Enable the EEG Browser components',4); +INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (125,'useEEGBrowserVisualizationComponents','Whether to enable the visualization components on the EEG Browser module',1,0,'boolean',39,'Enable the EEG Browser components',4); INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (126,'createVisit','Enable visit creation in the imaging pipeline',1,0,'boolean',69,'Enable visit creation',11); INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (127,'default_project','Default project used when creating scan candidate or visit',1,0,'text',69,'Default project',12); INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (128,'default_cohort','Default cohort used when creating scan visit',1,0,'text',69,'Default cohort',13); @@ -121,5 +120,8 @@ INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMult INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (130,'DownloadPath','Where files are downloaded',1,0,'text',26,'Downloads',4); INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (131,'EEGUploadIncomingPath', 'Path to the upload directory for incoming EEG studies', 1, 0, 'text', 26, 'EEG Incoming Directory', 15); INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (132,'useDoB','Use DoB (Date of Birth)',1,0,'boolean',1,'Use DoB',12); +INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (133,INSERT INTO ConfigSettings (Name, Description, Visible, AllowMultiple, DataType, Parent, Label, OrderNumber) SELECT 'useSiteProjectPermissions', 'Only allow users access to data with a sessionID (for site and project access restrictions). Bypassed by each module `nosessionid` permission for admins', 1, 0, 'boolean', 50, 'Use Site Project Permissions', 6); + + UNLOCK TABLES; SET FOREIGN_KEY_CHECKS=1; diff --git a/raisinbread/RB_files/RB_permissions.sql b/raisinbread/RB_files/RB_permissions.sql index 235183feae1..3f4f8b34cc4 100644 --- a/raisinbread/RB_files/RB_permissions.sql +++ b/raisinbread/RB_files/RB_permissions.sql @@ -68,6 +68,7 @@ INSERT INTO `permissions` (`permID`, `code`, `description`, `moduleID`, `action` INSERT INTO `permissions` (`permID`, `code`, `description`, `moduleID`, `action`, `categoryID`) VALUES (74,'document_repository_categories','Categories',16,'Edit/Upload/Delete',2); INSERT INTO `permissions` (`permID`, `code`, `description`, `moduleID`, `action`, `categoryID`) VALUES (75,'document_repository_hidden','Restricted files',16,'View',2); INSERT INTO `permissions` (`permID`, `code`, `description`, `moduleID`, `action`, `categoryID`) VALUES (76,'media_upload_digest','Media files: Access to recently uploaded media notifications digest.',29,'Edit',2); +INSERT INTO `permissions` (`permID`, `code`, `description`, `moduleID`, `action`, `categoryID`) VALUES (77,'imaging_uploader_nosessionid', 'uploads with no session ID',22,'View',2); UNLOCK TABLES; SET FOREIGN_KEY_CHECKS=1;