From c25e1ab5bf22ccd1c74d1083946632400d5f3bae Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Thu, 14 Nov 2024 16:18:34 -0500 Subject: [PATCH] Remove calls to isPluginUser Signed-off-by: Craig Perkins --- .../org/opensearch/security/privileges/ActionPrivileges.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/opensearch/security/privileges/ActionPrivileges.java b/src/main/java/org/opensearch/security/privileges/ActionPrivileges.java index 67ba95e587..8cceb99773 100644 --- a/src/main/java/org/opensearch/security/privileges/ActionPrivileges.java +++ b/src/main/java/org/opensearch/security/privileges/ActionPrivileges.java @@ -442,7 +442,7 @@ PrivilegesEvaluatorResponse providesPrivilege(PrivilegesEvaluationContext contex } // 4: If plugin is performing the action, check if plugin has permission - if (context.getUser().isPluginUser()) { + if (this.usersToActionMatcher.containsKey(context.getUser().getName())) { WildcardMatcher matcher = this.usersToActionMatcher.get(context.getUser().getName()); if (matcher != null && matcher.test(action)) { return PrivilegesEvaluatorResponse.ok(); @@ -519,7 +519,7 @@ PrivilegesEvaluatorResponse providesAnyPrivilege(PrivilegesEvaluationContext con } // 4: If plugin is performing the action, check if plugin has permission - if (context.getUser().isPluginUser()) { + if (this.usersToActionMatcher.containsKey(context.getUser().getName())) { WildcardMatcher matcher = this.usersToActionMatcher.get(context.getUser().getName()); for (String action : actions) { if (matcher != null && matcher.test(action)) {