You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2014/04/01 17:15:41 UTC
svn commit: r1583710 - in /hive/branches/branch-0.13:
metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
ql/src/test/results/clientpositive/authorization_9.q.out
ql/src/test/results/clientpositive/show_roles.q.out
Author: hashutosh
Date: Tue Apr 1 15:15:41 2014
New Revision: 1583710
URL: http://svn.apache.org/r1583710
Log:
HIVE-6795 : metastore initialization should add default roles with default, SBA (Thejas Nair via Ashutosh Chauhan)
Modified:
hive/branches/branch-0.13/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
hive/branches/branch-0.13/ql/src/test/results/clientpositive/authorization_9.q.out
hive/branches/branch-0.13/ql/src/test/results/clientpositive/show_roles.q.out
Modified: hive/branches/branch-0.13/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.13/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java?rev=1583710&r1=1583709&r2=1583710&view=diff
==============================================================================
--- hive/branches/branch-0.13/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java (original)
+++ hive/branches/branch-0.13/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java Tue Apr 1 15:15:41 2014
@@ -528,24 +528,6 @@ public class HiveMetaStore extends Thrif
}
}
- private boolean areWeAllowedToCreate() {
-
- Class<?> authCls;
- Class<?> authIface;
- try {
- authCls = hiveConf.getClassByName(hiveConf.getVar(ConfVars.HIVE_AUTHORIZATION_MANAGER));
- authIface = Class.forName("org.apache.hadoop.hive.ql.security.authorization.plugin.HiveAuthorizerFactory");
- } catch (ClassNotFoundException e) {
- LOG.debug("No auth manager specified", e);
- return false;
- }
- if(!authIface.isAssignableFrom(authCls)){
- LOG.warn("Configured auth manager "+authCls.getName()+" doesn't implement "+ ConfVars.HIVE_AUTHENTICATOR_MANAGER);
- return false;
- }
-
- return true;
- }
private void createDefaultRoles() throws MetaException {
@@ -554,10 +536,6 @@ public class HiveMetaStore extends Thrif
return;
}
- if(!areWeAllowedToCreate()) {
- return;
- }
-
RawStore ms = getMS();
try {
ms.addRole(ADMIN, ADMIN);
@@ -601,9 +579,6 @@ public class HiveMetaStore extends Thrif
LOG.debug("Admin users already added.");
return;
}
- if(!areWeAllowedToCreate()) {
- return;
- }
// now add pre-configured users to admin role
String userStr = HiveConf.getVar(hiveConf,ConfVars.USERS_IN_ADMIN_ROLE,"").trim();
if (userStr.isEmpty()) {
Modified: hive/branches/branch-0.13/ql/src/test/results/clientpositive/authorization_9.q.out
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.13/ql/src/test/results/clientpositive/authorization_9.q.out?rev=1583710&r1=1583709&r2=1583710&view=diff
==============================================================================
--- hive/branches/branch-0.13/ql/src/test/results/clientpositive/authorization_9.q.out (original)
+++ hive/branches/branch-0.13/ql/src/test/results/clientpositive/authorization_9.q.out Tue Apr 1 15:15:41 2014
@@ -63,6 +63,7 @@ PREHOOK: query: show grant on all
PREHOOK: type: SHOW_GRANT
POSTHOOK: query: show grant on all
POSTHOOK: type: SHOW_GRANT
+ ADMIN ROLE All true -1 ADMIN
default hive_test_user USER Select false -1 hive_test_user
default hive_test_user2 USER Select false -1 hive_test_user
default dummy hive_test_user USER Select false -1 hive_test_user
Modified: hive/branches/branch-0.13/ql/src/test/results/clientpositive/show_roles.q.out
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.13/ql/src/test/results/clientpositive/show_roles.q.out?rev=1583710&r1=1583709&r2=1583710&view=diff
==============================================================================
--- hive/branches/branch-0.13/ql/src/test/results/clientpositive/show_roles.q.out (original)
+++ hive/branches/branch-0.13/ql/src/test/results/clientpositive/show_roles.q.out Tue Apr 1 15:15:41 2014
@@ -10,5 +10,7 @@ PREHOOK: query: show roles
PREHOOK: type: SHOW_ROLES
POSTHOOK: query: show roles
POSTHOOK: type: SHOW_ROLES
+ADMIN
+PUBLIC
role1
role2