Mercurial > hg > orthanc-authorization
changeset 80:0ffad746a16b
fix DicomWEB routes
author | Alain Mazy <am@osimis.io> |
---|---|
date | Thu, 16 Mar 2023 11:08:55 +0100 |
parents | 94c5388ed30b |
children | fac45493d547 |
files | Plugin/DefaultAuthorizationParser.cpp UnitTestsSources/UnitTestsMain.cpp |
diffstat | 2 files changed, 29 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/Plugin/DefaultAuthorizationParser.cpp Thu Mar 16 10:39:27 2023 +0100 +++ b/Plugin/DefaultAuthorizationParser.cpp Thu Mar 16 11:08:55 2023 +0100 @@ -44,13 +44,13 @@ "^" + tmp + "/studies/([.0-9]+)(|/series)(|/)$"); dicomWebSeries_ = boost::regex( - "^" + tmp + "/studies/([.0-9]+)/series/([.0-9]+)(|/instances)(|/)$"); + "^" + tmp + "/studies/([.0-9]+)/series/([.0-9]+)(|/instances|/rendered|/metadata)(|/)$"); dicomWebInstances_ = boost::regex( - "^" + tmp + "/studies/([.0-9]+)/series/([.0-9]+)/instances/([.0-9]+)(|/|/frames/.*)$"); + "^" + tmp + "/studies/([.0-9]+)/series/([.0-9]+)/instances/([.0-9]+)(|/|/frames/.*|/rendered|/metadata)(|/)$"); dicomWebQidoRsFind_ = boost::regex( - "^" + tmp + "/(studies|series|instances)$"); + "^" + tmp + "/(studies|series|instances)(|/)$"); }
--- a/UnitTestsSources/UnitTestsMain.cpp Thu Mar 16 10:39:27 2023 +0100 +++ b/UnitTestsSources/UnitTestsMain.cpp Thu Mar 16 11:08:55 2023 +0100 @@ -166,6 +166,18 @@ ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Patient, patientOrthancId)); accesses.clear(); + parser.Parse(accesses, "/dicom-web/studies/2.2/series/3.3/rendered", noGetArguments.GetMap()); + ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Series, seriesOrthancId)); + ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Study, studyOrthancId)); + ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Patient, patientOrthancId)); + + accesses.clear(); + parser.Parse(accesses, "/dicom-web/studies/2.2/series/3.3/metadata", noGetArguments.GetMap()); + ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Series, seriesOrthancId)); + ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Study, studyOrthancId)); + ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Patient, patientOrthancId)); + + accesses.clear(); parser.Parse(accesses, "/dicom-web/studies/2.2/series/3.3/instances/4.4", noGetArguments.GetMap()); ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Instance, instanceOrthancId)); ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Series, seriesOrthancId)); @@ -173,12 +185,26 @@ ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Patient, patientOrthancId)); accesses.clear(); + parser.Parse(accesses, "/dicom-web/studies/2.2/series/3.3/instances/4.4/metadata", noGetArguments.GetMap()); + ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Instance, instanceOrthancId)); + ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Series, seriesOrthancId)); + ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Study, studyOrthancId)); + ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Patient, patientOrthancId)); + + accesses.clear(); parser.Parse(accesses, "/dicom-web/studies/2.2/series/3.3/instances/4.4/frames/0", noGetArguments.GetMap()); ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Instance, instanceOrthancId)); ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Series, seriesOrthancId)); ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Study, studyOrthancId)); ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Patient, patientOrthancId)); + accesses.clear(); + parser.Parse(accesses, "/dicom-web/studies/2.2/series/3.3/instances/4.4/frames/0/rendered", noGetArguments.GetMap()); + ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Instance, instanceOrthancId)); + ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Series, seriesOrthancId)); + ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Study, studyOrthancId)); + ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Patient, patientOrthancId)); + { accesses.clear(); const char* getKeys[] = {"0020000D"};