for (HivePrivilegeObject hiveObj : hiveObjects) { if (hiveObj.getType() == HivePrivilegeObject.HivePrivilegeObjectType.LOCAL_URI) { needAdmin = true; break;
/** * Convert thrift HiveObjectRef to plugin HivePrivilegeObject * @param privObj * @return * @throws HiveException */ public static HiveObjectRef getThriftHiveObjectRef(HivePrivilegeObject privObj) throws HiveException { if (privObj == null) { return null; } HiveObjectType objType = getThriftHiveObjType(privObj.getType()); return new HiveObjectRef(objType, privObj.getDbname(), privObj.getObjectName(), null, null); }
/** * Convert thrift HiveObjectRef to plugin HivePrivilegeObject * @param privObj * @return * @throws HiveException */ public static HiveObjectRef getThriftHiveObjectRef(HivePrivilegeObject privObj) throws HiveException { if (privObj == null) { return null; } HiveObjectType objType = getThriftHiveObjType(privObj.getType()); return new HiveObjectRef(objType, privObj.getDbname(), privObj.getObjectName(), null, null); }
@Override public HiveResourceACLs getResourceACLs(HivePrivilegeObject hiveObject) { HiveResourceACLs acls = null; try { switch (hiveObject.getType()) { case DATABASE: Database db = Hive.get().getDatabase(hiveObject.getDbname()); acls = getResourceACLs(new Path(db.getLocationUri())); break; case TABLE_OR_VIEW: case COLUMN: Table table = Hive.get().getTable(hiveObject.getDbname(), hiveObject.getObjectName()); acls = getResourceACLs(new Path(table.getTTable().getSd().getLocation())); break; default: // Shall never happen throw new RuntimeException("Unknown request type:" + hiveObject.getType()); } } catch (Exception e) { } return acls; }
continue; if (opPriv.getObjectType() != null && opPriv.getObjectType() != hObj.getType()) { continue;
List<String> curRoles, HivePrivilegeObject hivePrivObject) throws HiveAuthzPluginException { switch (hivePrivObject.getType()) { case TABLE_OR_VIEW: { Table thriftTableObj = null;
continue; if (opPriv.getObjectType() != null && opPriv.getObjectType() != hObj.getType()) { continue;
List<String> curRoles, HivePrivilegeObject hivePrivObject) throws HiveAuthzPluginException { switch (hivePrivObject.getType()) { case TABLE_OR_VIEW: { Table thriftTableObj = null;
switch (hiveObj.getType()) { case LOCAL_URI: case DFS_URI:
switch (hiveObj.getType()) { case LOCAL_URI: case DFS_URI:
/** * Convert thrift HiveObjectRef to plugin HivePrivilegeObject * @param privObj * @return * @throws HiveException */ public static HiveObjectRef getThriftHiveObjectRef(HivePrivilegeObject privObj) throws HiveException { if (privObj == null) { return null; } HiveObjectType objType = getThriftHiveObjType(privObj.getType()); return new HiveObjectRef(objType, privObj.getDbname(), privObj.getObjectName(), null, null); }
continue; if (opPriv.getObjectType() != null && opPriv.getObjectType() != hObj.getType()) { continue;
switch (hiveObj.getType()) { case LOCAL_URI: case DFS_URI:
List<String> curRoles, HivePrivilegeObject hivePrivObject) throws HiveAuthzPluginException { switch (hivePrivObject.getType()) { case TABLE_OR_VIEW: { Table thriftTableObj = null;