You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ma...@apache.org on 2016/12/28 05:56:37 UTC

incubator-ranger git commit: RANGER-1210: update RangerHivePlugin grant/revoke to treat insert/delete as update permission

Repository: incubator-ranger
Updated Branches:
  refs/heads/master 43e2f3d13 -> 31701840c


RANGER-1210: update RangerHivePlugin grant/revoke to treat insert/delete as update permission

Signed-off-by: Madhan Neethiraj <ma...@apache.org>


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

Branch: refs/heads/master
Commit: 31701840c03d2ecd87c282dae874c55865bcf907
Parents: 43e2f3d
Author: Yan Zhou <yz...@yahoo.com>
Authored: Tue Dec 27 21:30:53 2016 -0800
Committer: Madhan Neethiraj <ma...@apache.org>
Committed: Tue Dec 27 21:55:17 2016 -0800

----------------------------------------------------------------------
 .../authorization/hive/authorizer/RangerHiveAuthorizer.java      | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/31701840/hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizer.java
----------------------------------------------------------------------
diff --git a/hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizer.java b/hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizer.java
index fa1ea02..e6230ec 100644
--- a/hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizer.java
+++ b/hive-agent/src/main/java/org/apache/ranger/authorization/hive/authorizer/RangerHiveAuthorizer.java
@@ -1200,6 +1200,10 @@ public class RangerHiveAuthorizer extends RangerHiveAuthorizerBase {
 			   StringUtils.equalsIgnoreCase(privName, HiveAccessType.SELECT.name()) ||
 			   StringUtils.equalsIgnoreCase(privName, HiveAccessType.UPDATE.name())) {
 				ret.getAccessTypes().add(privName.toLowerCase());
+			} else if (StringUtils.equalsIgnoreCase(privName, "Insert") ||
+							StringUtils.equalsIgnoreCase(privName, "Delete")) {
+				// Mapping Insert/Delete to Update
+				ret.getAccessTypes().add(HiveAccessType.UPDATE.name().toLowerCase());
 			} else {
 				LOG.warn("grant/revoke: unexpected privilege type '" + privName + "'. Ignored");
 			}