This is an automated email from the ASF dual-hosted git repository.

nikhil pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/master by this push:
     new 66ff8bd  RANGER-2660-addendum patch
66ff8bd is described below

commit 66ff8bd23a4f7713a6f935c62f398ef54e84da70
Author: Nikhil P <nik...@apache.org>
AuthorDate: Fri Dec 20 18:32:55 2019 +0530

    RANGER-2660-addendum patch
---
 .../src/main/java/org/apache/ranger/biz/RangerBizUtil.java     | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git 
a/security-admin/src/main/java/org/apache/ranger/biz/RangerBizUtil.java 
b/security-admin/src/main/java/org/apache/ranger/biz/RangerBizUtil.java
index 974fc18..71511dc 100644
--- a/security-admin/src/main/java/org/apache/ranger/biz/RangerBizUtil.java
+++ b/security-admin/src/main/java/org/apache/ranger/biz/RangerBizUtil.java
@@ -63,6 +63,7 @@ import org.apache.ranger.plugin.model.RangerBaseModelObject;
 import org.apache.ranger.plugin.model.RangerService;
 import org.apache.ranger.plugin.store.EmbeddedServiceDefsUtil;
 import org.apache.ranger.rest.ServiceREST;
+import org.apache.ranger.security.context.RangerAdminOpContext;
 import org.apache.ranger.security.context.RangerContextHolder;
 import org.apache.ranger.view.VXPortalUser;
 import org.apache.ranger.view.VXResource;
@@ -1495,7 +1496,14 @@ public class RangerBizUtil {
        }
 
        public static boolean setBulkMode(boolean val) {
-               RangerContextHolder.getOpContext().setBulkModeContext(val);
+               if(RangerContextHolder.getOpContext()!=null){
+                       
RangerContextHolder.getOpContext().setBulkModeContext(val);
+               }
+               else {
+                         RangerAdminOpContext opContext = new 
RangerAdminOpContext();
+                         opContext.setBulkModeContext(val);
+                         RangerContextHolder.setOpContext(opContext);
+               }
                return isBulkMode();
        }
 

Reply via email to