ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sneet...@apache.org
Subject git commit: ARGUS-43:Fixed NPE during grant call without repo type
Date Tue, 16 Sep 2014 15:04:16 GMT
Repository: incubator-argus
Updated Branches:
  refs/heads/master d3e9ad6d1 -> c99b51c76


ARGUS-43:Fixed NPE during grant call without repo type

Signed-off-by: sneethiraj <sneethir@apache.org>


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

Branch: refs/heads/master
Commit: c99b51c76007fa9c286c5ecb047142109da899aa
Parents: d3e9ad6
Author: vperiasamy <vperiasamy@hortonworks.com>
Authored: Fri Sep 12 01:51:18 2014 -0400
Committer: sneethiraj <sneethir@apache.org>
Committed: Tue Sep 16 11:04:03 2014 -0400

----------------------------------------------------------------------
 .../main/java/com/xasecure/service/XPolicyService.java    | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/c99b51c7/security-admin/src/main/java/com/xasecure/service/XPolicyService.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/com/xasecure/service/XPolicyService.java b/security-admin/src/main/java/com/xasecure/service/XPolicyService.java
index 65e6776..a643e3b 100644
--- a/security-admin/src/main/java/com/xasecure/service/XPolicyService.java
+++ b/security-admin/src/main/java/com/xasecure/service/XPolicyService.java
@@ -233,8 +233,14 @@ public class XPolicyService extends PublicAPIServiceBase<VXResource,
VXPolicy> {
 		vXResource.setColumns(vXPolicy.getColumns());
 		vXResource.setUdfs(vXPolicy.getUdfs());
 		vXResource.setAssetName(vXPolicy.getRepositoryName());
-		vXResource.setAssetType(AppConstants.getEnumFor_AssetType(vXPolicy
-				.getRepositoryType()));
+		
+		int assetType = AppConstants.getEnumFor_AssetType(vXPolicy
+				.getRepositoryType());
+		if (assetType == 0 || assetType == AppConstants.ASSET_UNKNOWN) {
+			assetType = xAsset.getAssetType();
+			vXPolicy.setRepositoryType(AppConstants.getLabelFor_AssetType(assetType));
+		}
+		vXResource.setAssetType(assetType);
 
 		int resourceStatus = AppConstants.STATUS_ENABLED;
 		if (!vXPolicy.getIsEnabled()) {


Mime
View raw message