Mercurial > hg > orthanc-authorization
comparison Plugin/AuthorizationParserBase.h @ 1:d5d3cb00556a
initial release
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 22 Mar 2017 16:13:52 +0100 |
parents | |
children | bc0431cb6b8f |
comparison
equal
deleted
inserted
replaced
0:decac5df19c4 | 1:d5d3cb00556a |
---|---|
1 /** | |
2 * Advanced authorization plugin for Orthanc | |
3 * Copyright (C) 2017 Osimis, Belgium | |
4 * | |
5 * This program is free software: you can redistribute it and/or | |
6 * modify it under the terms of the GNU Affero General Public License | |
7 * as published by the Free Software Foundation, either version 3 of | |
8 * the License, or (at your option) any later version. | |
9 * | |
10 * This program is distributed in the hope that it will be useful, but | |
11 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 * Affero General Public License for more details. | |
14 * | |
15 * You should have received a copy of the GNU Affero General Public License | |
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
17 **/ | |
18 | |
19 #pragma once | |
20 | |
21 #include "IAuthorizationParser.h" | |
22 #include "ResourceHierarchyCache.h" | |
23 | |
24 namespace OrthancPlugins | |
25 { | |
26 class AuthorizationParserBase : public IAuthorizationParser | |
27 { | |
28 private: | |
29 std::auto_ptr<ResourceHierarchyCache> resourceHierarchy_; | |
30 | |
31 void AddResourceInternal(AccessedResources& target, | |
32 Orthanc::ResourceType level, | |
33 const std::string& orthancId); | |
34 | |
35 protected: | |
36 void AddOrthancInstance(AccessedResources& target, | |
37 const std::string& orthancId); | |
38 | |
39 void AddOrthancSeries(AccessedResources& target, | |
40 const std::string& orthancId); | |
41 | |
42 void AddOrthancStudy(AccessedResources& target, | |
43 const std::string& orthancId); | |
44 | |
45 void AddOrthancPatient(AccessedResources& target, | |
46 const std::string& orthancId); | |
47 | |
48 void AddDicomStudy(AccessedResources& target, | |
49 const std::string& studyDicomUid); | |
50 | |
51 void AddDicomSeries(AccessedResources& target, | |
52 const std::string& studyDicomUid, | |
53 const std::string& seriesDicomUid); | |
54 | |
55 void AddDicomInstance(AccessedResources& target, | |
56 const std::string& studyDicomUid, | |
57 const std::string& seriesDicomUid, | |
58 const std::string& instanceDicomUid); | |
59 | |
60 public: | |
61 AuthorizationParserBase(OrthancPluginContext* context, | |
62 ICacheFactory& factory); | |
63 | |
64 virtual void Invalidate(Orthanc::ResourceType level, | |
65 const std::string& id) | |
66 { | |
67 resourceHierarchy_->Invalidate(level, id); | |
68 } | |
69 }; | |
70 } |