Mercurial > hg > orthanc-authorization
comparison Plugin/BaseAuthorizationService.h @ 190:de232f9b3a60
cppcheck
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 05 Jun 2024 15:08:41 +0200 |
parents | c4b908970ae4 |
children |
comparison
equal
deleted
inserted
replaced
188:c4b908970ae4 | 190:de232f9b3a60 |
---|---|
19 **/ | 19 **/ |
20 | 20 |
21 #pragma once | 21 #pragma once |
22 | 22 |
23 #include "IAuthorizationService.h" | 23 #include "IAuthorizationService.h" |
24 | |
25 #include <Compatibility.h> | |
24 | 26 |
25 | 27 |
26 namespace OrthancPlugins | 28 namespace OrthancPlugins |
27 { | 29 { |
28 class CachedAuthorizationService; | 30 class CachedAuthorizationService; |
53 | 55 |
54 virtual bool IsGranted(unsigned int& validity, | 56 virtual bool IsGranted(unsigned int& validity, |
55 OrthancPluginHttpMethod method, | 57 OrthancPluginHttpMethod method, |
56 const AccessedResource& access, | 58 const AccessedResource& access, |
57 const Token& token, | 59 const Token& token, |
58 const std::string& tokenValue) | 60 const std::string& tokenValue) ORTHANC_OVERRIDE |
59 { | 61 { |
60 return IsGrantedInternal(validity, method, access, &token, tokenValue); | 62 return IsGrantedInternal(validity, method, access, &token, tokenValue); |
61 } | 63 } |
62 | 64 |
63 virtual bool IsGrantedToAnonymousUser(unsigned int& validity, | 65 virtual bool IsGrantedToAnonymousUser(unsigned int& validity, |
64 OrthancPluginHttpMethod method, | 66 OrthancPluginHttpMethod method, |
65 const AccessedResource& access) | 67 const AccessedResource& access) ORTHANC_OVERRIDE |
66 { | 68 { |
67 return IsGrantedInternal(validity, method, access, NULL, ""); | 69 return IsGrantedInternal(validity, method, access, NULL, ""); |
68 } | 70 } |
69 | 71 |
70 virtual bool GetUserProfile(unsigned int& validity, | 72 virtual bool GetUserProfile(unsigned int& validity, |
71 UserProfile& profile /* out */, | 73 UserProfile& profile /* out */, |
72 const Token& token, | 74 const Token& token, |
73 const std::string& tokenValue) | 75 const std::string& tokenValue) ORTHANC_OVERRIDE |
74 { | 76 { |
75 return GetUserProfileInternal(validity, profile, &token, tokenValue); | 77 return GetUserProfileInternal(validity, profile, &token, tokenValue); |
76 } | 78 } |
77 | 79 |
78 virtual bool GetAnonymousUserProfile(unsigned int& validity /* out */, | 80 virtual bool GetAnonymousUserProfile(unsigned int& validity /* out */, |
79 UserProfile& profile /* out */) | 81 UserProfile& profile /* out */) ORTHANC_OVERRIDE |
80 { | 82 { |
81 return GetUserProfileInternal(validity, profile, NULL, ""); | 83 return GetUserProfileInternal(validity, profile, NULL, ""); |
82 } | 84 } |
83 | 85 |
84 virtual bool HasUserPermission(unsigned int& validity /* out */, | 86 virtual bool HasUserPermission(unsigned int& validity /* out */, |
85 const std::set<std::string>& anyOfPermissions, | 87 const std::set<std::string>& anyOfPermissions, |
86 const UserProfile& profile) | 88 const UserProfile& profile) ORTHANC_OVERRIDE |
87 { | 89 { |
88 if (anyOfPermissions.size() == 0) | 90 if (anyOfPermissions.size() == 0) |
89 { | 91 { |
90 return true; | 92 return true; |
91 } | 93 } |
99 } | 101 } |
100 return false; | 102 return false; |
101 } | 103 } |
102 | 104 |
103 virtual bool HasAnonymousUserPermission(unsigned int& validity /* out */, | 105 virtual bool HasAnonymousUserPermission(unsigned int& validity /* out */, |
104 const std::set<std::string>& anyOfPermissions) | 106 const std::set<std::string>& anyOfPermissions) ORTHANC_OVERRIDE |
105 { | 107 { |
106 if (anyOfPermissions.size() == 0) | 108 if (anyOfPermissions.size() == 0) |
107 { | 109 { |
108 return true; | 110 return true; |
109 } | 111 } |