private static Privilege getPrivilegeFromRegistry(PrivilegeType ptype) { return SessionState.get().isAuthorizationModeV2() ? RegistryV2.get(ptype) : Registry.get(ptype); }
private static Privilege getPrivilegeFromRegistry(PrivilegeType ptype) { return SessionState.get().isAuthorizationModeV2() ? RegistryV2.get(ptype) : Registry.get(ptype); }
protected boolean isAuthV2Enabled(){ SessionState ss = SessionState.get(); return (ss.isAuthorizationModeV2() && HiveConf.getBoolVar(ss.getConf(), HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED)); }
/** * Authorize command of given type, arguments and for service hosts (for Service Type authorization) * * @param ss - session state * @param type - operation type * @param command - command args * @param serviceObject - service object * @return null if there was no authorization error. Otherwise returns CommandProcessorResponse * capturing the authorization error */ static CommandProcessorResponse authorizeCommandAndServiceObject(SessionState ss, HiveOperationType type, List<String> command, String serviceObject) { if (ss == null) { // ss can be null in unit tests return null; } if (ss.isAuthorizationModeV2() && HiveConf.getBoolVar(ss.getConf(), HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED)) { String errMsg = "Error authorizing command " + command; try { authorizeCommandThrowEx(ss, type, command, serviceObject); // authorized to perform action return null; } catch (HiveAuthzPluginException | HiveAccessControlException e) { LOG.error(errMsg, e); return CommandProcessorResponse.create(e); } } return null; }
if (ss.isAuthorizationModeV2() && HiveConf.getBoolVar(ss.getConf(), HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED)) { String errMsg = "Error authorizing command " + command;
if (ss.isAuthorizationModeV2() && HiveConf.getBoolVar(ss.getConf(), HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED)) { String errMsg = "Error authorizing command " + command;
Set<WriteEntity> outputs = Sets.union(sem.getOutputs(), additionalOutputs); if (ss.isAuthorizationModeV2()) {
boolean isColumnInfoNeedForAuth = SessionState.get().isAuthorizationModeV2() && HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED); if (isColumnInfoNeedForAuth
boolean isColumnInfoNeedForAuth = SessionState.get().isAuthorizationModeV2() && HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED); if (isColumnInfoNeedForAuth
Set<WriteEntity> outputs = Sets.union(sem.getOutputs(), additionalOutputs); if (ss.isAuthorizationModeV2()) {
private static Privilege getPrivilegeFromRegistry(PrivilegeType ptype) { return SessionState.get().isAuthorizationModeV2() ? RegistryV2.get(ptype) : Registry.get(ptype); }
protected boolean isAuthV2Enabled(){ SessionState ss = SessionState.get(); return (ss.isAuthorizationModeV2() && HiveConf.getBoolVar(ss.getConf(), HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED)); }
protected boolean isAuthV2Enabled(){ SessionState ss = SessionState.get(); return (ss.isAuthorizationModeV2() && HiveConf.getBoolVar(ss.getConf(), HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED)); }
protected boolean isAuthV2Enabled(){ SessionState ss = SessionState.get(); return (ss.isAuthorizationModeV2() && HiveConf.getBoolVar(ss.getConf(), HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED)); }
protected boolean isAuthV2Enabled(){ SessionState ss = SessionState.get(); return (ss.isAuthorizationModeV2() && HiveConf.getBoolVar(ss.getConf(), HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED)); }
protected boolean isAuthV2Enabled(){ SessionState ss = SessionState.get(); return (ss.isAuthorizationModeV2() && HiveConf.getBoolVar(ss.getConf(), HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED)); }
if (ss.isAuthorizationModeV2() && HiveConf.getBoolVar(ss.getConf(), HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED)) { String errMsg = "Error authorizing command " + command;
Set<WriteEntity> outputs = Sets.union(sem.getOutputs(), additionalOutputs); if (ss.isAuthorizationModeV2()) {
boolean isColumnInfoNeedForAuth = SessionState.get().isAuthorizationModeV2() && HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED); if (isColumnInfoNeedForAuth