@Override public HiveAuthorizer createHiveAuthorizer(HiveMetastoreClientFactory metastoreClientFactory, HiveConf conf, HiveAuthenticationProvider authenticator, HiveAuthzSessionContext ctx) throws HiveAuthzPluginException { SQLStdHiveAccessControllerWrapper privilegeManager = new SQLStdHiveAccessControllerWrapper(metastoreClientFactory, conf, authenticator, ctx); return new HiveAuthorizerImpl(privilegeManager, new DummyHiveAuthorizationValidator()); } }
if (!privController.isUserAdmin()) { deniedMessages.add(SQLPrivTypeGrant.ADMIN_PRIV.toString() + " on " + ioType); if (privController.isUserAdmin()) { availPrivs.addPrivilege(SQLPrivTypeGrant.ADMIN_PRIV); default: availPrivs = SQLAuthorizationUtils.getPrivilegesFromMetaStore(metastoreClient, userName, hiveObj, privController.getCurrentRoleNames(), privController.isUserAdmin());
@Override public void grantRole(List<HivePrincipal> hivePrincipals, List<String> roles, boolean grantOption, HivePrincipal grantorPrinc) throws HiveAuthzPluginException, HiveAccessControlException { // validate principals hivePrincipals = SQLAuthorizationUtils.getValidatedPrincipals(hivePrincipals); roles = getLowerCaseRoleNames(roles); grantorPrinc = SQLAuthorizationUtils.getValidatedPrincipal(grantorPrinc); hiveAccessController.grantRole(hivePrincipals, roles, grantOption, grantorPrinc); }
if (privController.isUserAdmin()) { availPrivs.addPrivilege(SQLPrivTypeGrant.ADMIN_PRIV); default: availPrivs = SQLAuthorizationUtils.getPrivilegesFromMetaStore(metastoreClient, userName, hiveObj, privController.getCurrentRoleNames(), privController.isUserAdmin());
@Override public void revokeRole(List<HivePrincipal> hivePrincipals, List<String> roles, boolean grantOption, HivePrincipal grantorPrinc) throws HiveAuthzPluginException, HiveAccessControlException { // validate hivePrincipals = SQLAuthorizationUtils.getValidatedPrincipals(hivePrincipals); roles = getLowerCaseRoleNames(roles); grantorPrinc = SQLAuthorizationUtils.getValidatedPrincipal(grantorPrinc); hiveAccessController.revokeRole(hivePrincipals, roles, grantOption, grantorPrinc); }
@Override public HiveAuthorizer createHiveAuthorizer(HiveMetastoreClientFactory metastoreClientFactory, HiveConf conf, HiveAuthenticationProvider authenticator, HiveAuthzSessionContext ctx) throws HiveAuthzPluginException { SQLStdHiveAccessControllerWrapper privilegeManager = new SQLStdHiveAccessControllerWrapper(metastoreClientFactory, conf, authenticator, ctx); return new HiveAuthorizerImpl( privilegeManager, new SQLStdHiveAuthorizationValidator(metastoreClientFactory, conf, authenticator, privilegeManager, ctx) ); } }
if (privController.isUserAdmin()) { availPrivs.addPrivilege(SQLPrivTypeGrant.ADMIN_PRIV); default: availPrivs = SQLAuthorizationUtils.getPrivilegesFromMetaStore(metastoreClient, userName, hiveObj, privController.getCurrentRoleNames(), privController.isUserAdmin());
@Override public void grantRole(List<HivePrincipal> hivePrincipals, List<String> roles, boolean grantOption, HivePrincipal grantorPrinc) throws HiveAuthzPluginException, HiveAccessControlException { // validate principals hivePrincipals = SQLAuthorizationUtils.getValidatedPrincipals(hivePrincipals); roles = getLowerCaseRoleNames(roles); grantorPrinc = SQLAuthorizationUtils.getValidatedPrincipal(grantorPrinc); hiveAccessController.grantRole(hivePrincipals, roles, grantOption, grantorPrinc); }
@Override public HiveAuthorizer createHiveAuthorizer(HiveMetastoreClientFactory metastoreClientFactory, HiveConf conf, HiveAuthenticationProvider authenticator, HiveAuthzSessionContext ctx) throws HiveAuthzPluginException { SQLStdHiveAccessControllerWrapper privilegeManager = new SQLStdHiveAccessControllerWrapper(metastoreClientFactory, conf, authenticator, ctx); return new HiveAuthorizerImpl( privilegeManager, new SQLStdHiveAuthorizationValidator(metastoreClientFactory, conf, authenticator, privilegeManager, ctx) ); } }
@Override public void revokeRole(List<HivePrincipal> hivePrincipals, List<String> roles, boolean grantOption, HivePrincipal grantorPrinc) throws HiveAuthzPluginException, HiveAccessControlException { // validate hivePrincipals = SQLAuthorizationUtils.getValidatedPrincipals(hivePrincipals); roles = getLowerCaseRoleNames(roles); grantorPrinc = SQLAuthorizationUtils.getValidatedPrincipal(grantorPrinc); hiveAccessController.revokeRole(hivePrincipals, roles, grantOption, grantorPrinc); }
@Override public HiveAuthorizer createHiveAuthorizer(HiveMetastoreClientFactory metastoreClientFactory, HiveConf conf, HiveAuthenticationProvider authenticator, HiveAuthzSessionContext ctx) throws HiveAuthzPluginException { SQLStdHiveAccessControllerWrapper privilegeManager = new SQLStdHiveAccessControllerWrapper(metastoreClientFactory, conf, authenticator, ctx); return new HiveAuthorizerImpl(privilegeManager, new DummyHiveAuthorizationValidator()); } }
@Override public void revokeRole(List<HivePrincipal> hivePrincipals, List<String> roles, boolean grantOption, HivePrincipal grantorPrinc) throws HiveAuthzPluginException, HiveAccessControlException { // validate hivePrincipals = SQLAuthorizationUtils.getValidatedPrincipals(hivePrincipals); roles = getLowerCaseRoleNames(roles); grantorPrinc = SQLAuthorizationUtils.getValidatedPrincipal(grantorPrinc); hiveAccessController.revokeRole(hivePrincipals, roles, grantOption, grantorPrinc); }
@Override public HiveAuthorizer createHiveAuthorizer(HiveMetastoreClientFactory metastoreClientFactory, HiveConf conf, HiveAuthenticationProvider authenticator, HiveAuthzSessionContext ctx) throws HiveAuthzPluginException { SQLStdHiveAccessControllerWrapper privilegeManager = new SQLStdHiveAccessControllerWrapper(metastoreClientFactory, conf, authenticator, ctx); return new HiveAuthorizerImpl( privilegeManager, new SQLStdHiveAuthorizationValidator(metastoreClientFactory, conf, authenticator, privilegeManager, ctx) ); } }
@Override public void grantRole(List<HivePrincipal> hivePrincipals, List<String> roles, boolean grantOption, HivePrincipal grantorPrinc) throws HiveAuthzPluginException, HiveAccessControlException { // validate principals hivePrincipals = SQLAuthorizationUtils.getValidatedPrincipals(hivePrincipals); roles = getLowerCaseRoleNames(roles); grantorPrinc = SQLAuthorizationUtils.getValidatedPrincipal(grantorPrinc); hiveAccessController.grantRole(hivePrincipals, roles, grantOption, grantorPrinc); }
@Override public HiveAuthorizer createHiveAuthorizer(HiveMetastoreClientFactory metastoreClientFactory, HiveConf conf, HiveAuthenticationProvider authenticator, HiveAuthzSessionContext ctx) throws HiveAuthzPluginException { SQLStdHiveAccessControllerWrapper privilegeManager = new SQLStdHiveAccessControllerWrapper(metastoreClientFactory, conf, authenticator, ctx); return new HiveAuthorizerImpl(privilegeManager, new DummyHiveAuthorizationValidator()); } }