Mercurial > hg > orthanc-authorization
comparison Plugin/IAuthorizationService.h @ 113:43154740ea2e
wip: checking labels
author | Alain Mazy <am@osimis.io> |
---|---|
date | Tue, 05 Sep 2023 12:48:20 +0200 |
parents | 572955904411 |
children | 9be1ee2b8fe1 |
comparison
equal
deleted
inserted
replaced
112:572955904411 | 113:43154740ea2e |
---|---|
56 struct UserProfile | 56 struct UserProfile |
57 { | 57 { |
58 std::string name; | 58 std::string name; |
59 std::set<std::string> permissions; | 59 std::set<std::string> permissions; |
60 std::set<std::string> authorizedLabels; | 60 std::set<std::string> authorizedLabels; |
61 | |
62 // the source token key/value that identified the user | |
63 TokenType tokenType; | |
64 std::string tokenKey; | |
65 std::string tokenValue; | |
61 }; | 66 }; |
62 | 67 |
63 virtual ~IAuthorizationService() | 68 virtual ~IAuthorizationService() |
64 { | 69 { |
65 } | 70 } |
82 virtual bool GetAnonymousUserProfile(unsigned int& validity /* out */, | 87 virtual bool GetAnonymousUserProfile(unsigned int& validity /* out */, |
83 UserProfile& profile /* out */) = 0; | 88 UserProfile& profile /* out */) = 0; |
84 | 89 |
85 virtual bool HasUserPermission(unsigned int& validity /* out */, | 90 virtual bool HasUserPermission(unsigned int& validity /* out */, |
86 const std::set<std::string>& anyOfPermissions, | 91 const std::set<std::string>& anyOfPermissions, |
87 const Token& token, | 92 const UserProfile& profile) = 0; |
88 const std::string& tokenValue) = 0; | |
89 | 93 |
90 virtual bool HasAnonymousUserPermission(unsigned int& validity /* out */, | 94 virtual bool HasAnonymousUserPermission(unsigned int& validity /* out */, |
91 const std::set<std::string>& anyOfPermissions) = 0; | 95 const std::set<std::string>& anyOfPermissions) = 0; |
92 | 96 |
93 virtual bool CreateToken(CreatedToken& response, | 97 virtual bool CreateToken(CreatedToken& response, |