ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spolavar...@apache.org
Subject [2/3] ranger git commit: RANGER-2070 : Ranger Storm service creation fails
Date Fri, 20 Apr 2018 18:04:45 GMT
RANGER-2070 : Ranger Storm service creation fails

Signed-off-by: Mehul Parikh <mehul@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/e6f96c09
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/e6f96c09
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/e6f96c09

Branch: refs/heads/master
Commit: e6f96c09225a2e52353f5a338a9f020cbbdc865f
Parents: f957fde
Author: fatimaawez <fatimakhan4689@gmail.com>
Authored: Thu Apr 19 20:02:52 2018 +0530
Committer: Sailaja Polavarapu <spolavarapu@hortonworks.com>
Committed: Fri Apr 20 11:02:19 2018 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/ranger/biz/ServiceMgr.java          | 2 --
 security-admin/src/main/java/org/apache/ranger/biz/UserMgr.java  | 4 +---
 .../src/test/java/org/apache/ranger/biz/TestUserMgr.java         | 2 +-
 3 files changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/e6f96c09/security-admin/src/main/java/org/apache/ranger/biz/ServiceMgr.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/biz/ServiceMgr.java b/security-admin/src/main/java/org/apache/ranger/biz/ServiceMgr.java
index acdfd2e..429c450 100644
--- a/security-admin/src/main/java/org/apache/ranger/biz/ServiceMgr.java
+++ b/security-admin/src/main/java/org/apache/ranger/biz/ServiceMgr.java
@@ -83,7 +83,6 @@ public class ServiceMgr {
 
 	public List<String> lookupResource(String serviceName, ResourceLookupContext context,
ServiceStore svcStore) throws Exception {
 		List<String> 	  ret = null;
-                rangerBizUtil.blockAuditorRoleUser();
 		RangerService service = svcDBStore.getServiceByName(serviceName);
 		
 		String authType = PropertiesUtil.getProperty(AUTHENTICATION_TYPE);
@@ -138,7 +137,6 @@ public class ServiceMgr {
 	
 	public VXResponse validateConfig(RangerService service, ServiceStore svcStore) throws Exception
{
 		VXResponse        ret = new VXResponse();
-                rangerBizUtil.blockAuditorRoleUser();
 		String authType = PropertiesUtil.getProperty(AUTHENTICATION_TYPE);
 		String lookupPrincipal = SecureClientLogin.getPrincipal(PropertiesUtil.getProperty(LOOKUP_PRINCIPAL),
PropertiesUtil.getProperty(HOST_NAME));
 		String lookupKeytab = PropertiesUtil.getProperty(LOOKUP_KEYTAB);

http://git-wip-us.apache.org/repos/asf/ranger/blob/e6f96c09/security-admin/src/main/java/org/apache/ranger/biz/UserMgr.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/biz/UserMgr.java b/security-admin/src/main/java/org/apache/ranger/biz/UserMgr.java
index ad806fb..6d94e4f 100644
--- a/security-admin/src/main/java/org/apache/ranger/biz/UserMgr.java
+++ b/security-admin/src/main/java/org/apache/ranger/biz/UserMgr.java
@@ -958,7 +958,6 @@ public class UserMgr {
 		 * if (RangerConstants.ROLE_USER.equals(gjUserRole.getUserRole())) {
 		 * return false; }
 		 */
-                rangerBizUtil.blockAuditorRoleUser();
 		boolean publicRole = false;
 		for (String publicRoleStr : publicRoles) {
 			if (publicRoleStr.equalsIgnoreCase(gjUserRole.getUserRole())) {
@@ -978,7 +977,6 @@ public class UserMgr {
 	}
 
 	public XXPortalUserRole addUserRole(Long userId, String userRole) {
-                rangerBizUtil.blockAuditorRoleUser();
 		List<XXPortalUserRole> roleList = daoManager.getXXPortalUserRole()
 				.findByUserId(userId);
 		boolean publicRole = false;
@@ -1001,6 +999,7 @@ public class UserMgr {
 								+ sess.toString(), new Throwable());
 				return null;
 			}
+                        rangerBizUtil.blockAuditorRoleUser();
 		}
 
 		for (XXPortalUserRole gjUserRole : roleList) {
@@ -1187,7 +1186,6 @@ public class UserMgr {
     protected VXPortalUser updateRoleForExternalUsers(
             Collection<String> reqRoleList,
             Collection<String> existingRoleList, VXPortalUser userProfileRes) {
-        rangerBizUtil.blockAuditorRoleUser();
         UserSessionBase session = ContextUtil.getCurrentUserSession();
         if (session != null && session.getXXPortalUser() != null && session.getXXPortalUser().getLoginId()
!= null &&  "rangerusersync".equals(session.getXXPortalUser().getLoginId())
                 && reqRoleList != null && !reqRoleList.isEmpty()

http://git-wip-us.apache.org/repos/asf/ranger/blob/e6f96c09/security-admin/src/test/java/org/apache/ranger/biz/TestUserMgr.java
----------------------------------------------------------------------
diff --git a/security-admin/src/test/java/org/apache/ranger/biz/TestUserMgr.java b/security-admin/src/test/java/org/apache/ranger/biz/TestUserMgr.java
index 307f435..10453a5 100644
--- a/security-admin/src/test/java/org/apache/ranger/biz/TestUserMgr.java
+++ b/security-admin/src/test/java/org/apache/ranger/biz/TestUserMgr.java
@@ -909,7 +909,7 @@ public class TestUserMgr {
 
 		Mockito.when(daoManager.getXXPortalUserRole()).thenReturn(roleDao);
 		Mockito.when(roleDao.findByUserId(userId)).thenReturn(list);
-                Mockito.doNothing().when(rangerBizUtil).blockAuditorRoleUser();
+                
 		boolean deleteValue = userMgr.deleteUserRole(userId, userRole);
 		Assert.assertTrue(deleteValue);
 	}


Mime
View raw message