/** * Find matching enum * * @param privTypeStr * privilege type string * @param isGrant * @return * @throws HiveAuthzPluginException */ public static SQLPrivTypeGrant getSQLPrivTypeGrant(String privTypeStr, boolean isGrant) throws HiveAuthzPluginException { SQLPrivilegeType ptype = SQLPrivilegeType.getRequirePrivilege(privTypeStr); return getSQLPrivTypeGrant(ptype, isGrant); }
/** * Find matching enum * * @param privTypeStr * privilege type string * @param isGrant * @return * @throws HiveAuthzPluginException */ public static SQLPrivTypeGrant getSQLPrivTypeGrant(String privTypeStr, boolean isGrant) throws HiveAuthzPluginException { SQLPrivilegeType ptype = SQLPrivilegeType.getRequirePrivilege(privTypeStr); return getSQLPrivTypeGrant(ptype, isGrant); }
/** * Check if the privileges are acceptable for SQL Standard authorization implementation * @param hivePrivileges * @throws HiveAuthzPluginException */ public static void validatePrivileges(List<HivePrivilege> hivePrivileges) throws HiveAuthzPluginException { for (HivePrivilege hivePrivilege : hivePrivileges) { if (hivePrivilege.getColumns() != null && hivePrivilege.getColumns().size() != 0) { throw new HiveAuthzPluginException( "Privilege with columns are not currently supported with sql standard authorization:" + hivePrivilege); } //try converting to the enum to verify that this is a valid privilege type SQLPrivilegeType.getRequirePrivilege(hivePrivilege.getName()); } }
/** * Check if the privileges are acceptable for SQL Standard authorization implementation * @param hivePrivileges * @throws HiveAuthzPluginException */ public static void validatePrivileges(List<HivePrivilege> hivePrivileges) throws HiveAuthzPluginException { for (HivePrivilege hivePrivilege : hivePrivileges) { if (hivePrivilege.getColumns() != null && hivePrivilege.getColumns().size() != 0) { throw new HiveAuthzPluginException( "Privilege with columns are not currently supported with sql standard authorization:" + hivePrivilege); } //try converting to the enum to verify that this is a valid privilege type SQLPrivilegeType.getRequirePrivilege(hivePrivilege.getName()); } }
/** * Find matching enum * * @param privTypeStr * privilege type string * @param isGrant * @return * @throws HiveAuthzPluginException */ public static SQLPrivTypeGrant getSQLPrivTypeGrant(String privTypeStr, boolean isGrant) throws HiveAuthzPluginException { SQLPrivilegeType ptype = SQLPrivilegeType.getRequirePrivilege(privTypeStr); return getSQLPrivTypeGrant(ptype, isGrant); }
/** * Check if the privileges are acceptable for SQL Standard authorization implementation * @param hivePrivileges * @throws HiveAuthzPluginException */ public static void validatePrivileges(List<HivePrivilege> hivePrivileges) throws HiveAuthzPluginException { for (HivePrivilege hivePrivilege : hivePrivileges) { if (hivePrivilege.getColumns() != null && hivePrivilege.getColumns().size() != 0) { throw new HiveAuthzPluginException( "Privilege with columns are not currently supported with sql standard authorization:" + hivePrivilege); } //try converting to the enum to verify that this is a valid privilege type SQLPrivilegeType.getRequirePrivilege(hivePrivilege.getName()); } }