diff --git a/services/distributeddataservice/service/data_share/data_share_service_impl.cpp b/services/distributeddataservice/service/data_share/data_share_service_impl.cpp index 6f1494aa931de0bf94c9359b9a07110c3d25b365..4029047bab8a89080ffdc0924ab8b0c7f0620296 100644 --- a/services/distributeddataservice/service/data_share/data_share_service_impl.cpp +++ b/services/distributeddataservice/service/data_share/data_share_service_impl.cpp @@ -1170,13 +1170,14 @@ bool DataShareServiceImpl::VerifyPermission(const std::string &bundleName, const } } else { Security::AccessToken::HapTokenInfo tokenInfo; - auto result = Security::AccessToken::AccessTokenKit::GetHapTokenInfo(tokenId, tokenInfo); - if (result == Security::AccessToken::RET_SUCCESS && tokenInfo.bundleName == bundleName) { - return true; - } // Provider from ProxyData, which does not allow empty permissions and cannot be access without configured if (permission.empty()) { - ZLOGE("Permission empty! token:0x%{public}x, bundleName:%{public}s", tokenId, bundleName.c_str()); + ZLOGI("Permission empty! token:0x%{public}x, bundleName:%{public}s", tokenId, bundleName.c_str()); + auto result = Security::AccessToken::AccessTokenKit::GetHapTokenInfo(tokenId, tokenInfo); + if (result == Security::AccessToken::RET_SUCCESS && tokenInfo.bundleName == bundleName) { + return true; + } + ZLOGE("Permission denied!"); return false; } // If the permission is NO_PERMISSION, access is also allowed