Skip to content

Commit

Permalink
Merge pull request #2463 from atlanhq/PLT-302
Browse files Browse the repository at this point in the history
PLT-302 Fix logging
  • Loading branch information
nikhilbonte21 authored Nov 10, 2023
2 parents 7425942 + b276fc1 commit aff75ca
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ private void personaPolicyToESDslClauses(List<AtlasEntity> policies,
if (getIsAllowPolicy(policy)) {
if (getPolicyActions(policy).contains(ACCESS_READ_PERSONA_METADATA)) {

if (terms.size() + assets.size() + 1 > assetsMaxLimit) {
int assetSize = terms.size() + assets.size() + 1;
if (assetSize > assetsMaxLimit) {
// For Metadata policies, along with assets we add 1 more clause for connection qualifiedName hence comparing with "assets.size() + 1"
throw new AtlasBaseException(AtlasErrorCode.PERSONA_POLICY_ASSETS_LIMIT_EXCEEDED, String.valueOf(assetsMaxLimit), String.valueOf(terms.size() + assets.size() + 1));
}
Expand All @@ -197,8 +198,10 @@ private void personaPolicyToESDslClauses(List<AtlasEntity> policies,
terms.add(connectionQName);

} else if (getPolicyActions(policy).contains(ACCESS_READ_PERSONA_GLOSSARY)) {

int assetSize = terms.size() + assets.size();
if (terms.size() + assets.size() > assetsMaxLimit) {
throw new AtlasBaseException(AtlasErrorCode.PERSONA_POLICY_ASSETS_LIMIT_EXCEEDED, String.valueOf(assetsMaxLimit), String.valueOf(terms.size() + assets.size()));
throw new AtlasBaseException(AtlasErrorCode.PERSONA_POLICY_ASSETS_LIMIT_EXCEEDED, String.valueOf(assetsMaxLimit), String.valueOf(assetSize));
}

for (String glossaryQName : assets) {
Expand Down

0 comments on commit aff75ca

Please sign in to comment.