Repository: incubator-ranger Updated Branches: refs/heads/ranger-0.5 987d959c3 -> bc0d196d6
RANGER-1161: trie prefilter updated to handle empty resource value Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/bc0d196d Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/bc0d196d Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/bc0d196d Branch: refs/heads/ranger-0.5 Commit: bc0d196d6af9025ab7a8962f31f43c39a15df6ef Parents: 987d959 Author: Madhan Neethiraj <[email protected]> Authored: Thu Sep 1 23:27:06 2016 -0700 Committer: Madhan Neethiraj <[email protected]> Committed: Thu Sep 1 23:27:06 2016 -0700 ---------------------------------------------------------------------- .../ranger/plugin/policyengine/RangerPolicyRepository.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/bc0d196d/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyRepository.java ---------------------------------------------------------------------- diff --git a/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyRepository.java b/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyRepository.java index 539d580..31f9720 100644 --- a/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyRepository.java +++ b/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyRepository.java @@ -157,7 +157,9 @@ public class RangerPolicyRepository { } public List<RangerPolicyEvaluator> getPolicyEvaluators(RangerAccessResource resource) { - return disableTrieLookupPrefilter ? getPolicyEvaluators() : getPolicyEvaluators(policyResourceTrie, resource); + String resourceStr = resource == null ? null : resource.getAsString(); + + return disableTrieLookupPrefilter || StringUtils.isEmpty(resourceStr) ? getPolicyEvaluators() : getPolicyEvaluators(policyResourceTrie, resource); } public static boolean isDelegateAdminPolicy(RangerPolicy policy) {
