Mercurial > hg > orthanc-authorization
diff Plugin/CachedAuthorizationService.cpp @ 113:43154740ea2e
wip: checking labels
author | Alain Mazy <am@osimis.io> |
---|---|
date | Tue, 05 Sep 2023 12:48:20 +0200 |
parents | 7381a7674b36 |
children | 0eed78c1e177 |
line wrap: on
line diff
--- a/Plugin/CachedAuthorizationService.cpp Thu Aug 31 16:51:15 2023 +0200 +++ b/Plugin/CachedAuthorizationService.cpp Tue Sep 05 12:48:20 2023 +0200 @@ -123,12 +123,12 @@ bool CachedAuthorizationService::HasUserPermissionInternal(unsigned int& validity, const std::string& permission, - const Token* token, - const std::string& tokenValue) + const UserProfile& profile) { assert(decorated_.get() != NULL); - std::string key = ComputeKey(permission, token, tokenValue); + Token token(profile.tokenType, profile.tokenKey); + std::string key = ComputeKey(permission, &token, profile.tokenValue); std::string value; if (cache_->Retrieve(value, key)) @@ -137,7 +137,7 @@ return (value == "1"); } - bool granted = decorated_->HasUserPermissionInternal(validity, permission, token, tokenValue); + bool granted = decorated_->HasUserPermissionInternal(validity, permission, profile); if (granted) {