void addMissingPrivilege(SQLPrivTypeGrant newPrivWGrant) { SQLPrivTypeGrant matchingPrivWGrant = priv2privWithGrant.get(newPrivWGrant.getPrivType()); if (matchingPrivWGrant != null) { if (matchingPrivWGrant.isWithGrant() || !newPrivWGrant.isWithGrant()) { // the existing entry already has grant, or new priv does not have // grant // no update needs to be done. return; } } // add the new entry priv2privWithGrant.put(newPrivWGrant.getPrivType(), newPrivWGrant); }
/** * 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 privType * @param isGrant * @return */ public static SQLPrivTypeGrant getSQLPrivTypeGrant( SQLPrivilegeType privType, boolean isGrant) { String typeName = privType.name() + (isGrant ? "_WGRANT" : "_NOGRANT"); return SQLPrivTypeGrant.valueOf(typeName); }
deniedMessages.add(SQLPrivTypeGrant.ADMIN_PRIV.toString() + " on " + ioType); return; // Ignore object, fail if not admin, succeed if admin.
deniedMessages.add(SQLPrivTypeGrant.ADMIN_PRIV.toString() + " on " + ioType);
void addMissingPrivilege(SQLPrivTypeGrant newPrivWGrant) { SQLPrivTypeGrant matchingPrivWGrant = priv2privWithGrant.get(newPrivWGrant.getPrivType()); if (matchingPrivWGrant != null) { if (matchingPrivWGrant.isWithGrant() || !newPrivWGrant.isWithGrant()) { // the existing entry already has grant, or new priv does not have // grant // no update needs to be done. return; } } // add the new entry priv2privWithGrant.put(newPrivWGrant.getPrivType(), newPrivWGrant); }
/** * 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 privType * @param isGrant * @return */ public static SQLPrivTypeGrant getSQLPrivTypeGrant( SQLPrivilegeType privType, boolean isGrant) { String typeName = privType.name() + (isGrant ? "_WGRANT" : "_NOGRANT"); return SQLPrivTypeGrant.valueOf(typeName); }
void addMissingPrivilege(SQLPrivTypeGrant newPrivWGrant) { SQLPrivTypeGrant matchingPrivWGrant = priv2privWithGrant.get(newPrivWGrant.getPrivType()); if (matchingPrivWGrant != null) { if (matchingPrivWGrant.isWithGrant() || !newPrivWGrant.isWithGrant()) { // the existing entry already has grant, or new priv does not have // grant // no update needs to be done. return; } } // add the new entry priv2privWithGrant.put(newPrivWGrant.getPrivType(), newPrivWGrant); }
public void addPrivilege(String priv, boolean withGrant) throws HiveAuthzPluginException { SQLPrivTypeGrant privType = SQLPrivTypeGrant.getSQLPrivTypeGrant(priv, withGrant); addPrivilege(privType); privilegeGrantSet.add(privType); if(withGrant){ //as with grant also implies without grant privilege, add without privilege as well addPrivilege(priv, false); } }
/** * Find matching enum * @param privType * @param isGrant * @return */ public static SQLPrivTypeGrant getSQLPrivTypeGrant( SQLPrivilegeType privType, boolean isGrant) { String typeName = privType.name() + (isGrant ? "_WGRANT" : "_NOGRANT"); return SQLPrivTypeGrant.valueOf(typeName); }
public void addPrivilege(String priv, boolean withGrant) throws HiveAuthzPluginException { SQLPrivTypeGrant privType = SQLPrivTypeGrant.getSQLPrivTypeGrant(priv, withGrant); addPrivilege(privType); privilegeGrantSet.add(privType); if(withGrant){ //as with grant also implies without grant privilege, add without privilege as well addPrivilege(priv, false); } }
/** * 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); }
public void addPrivilege(String priv, boolean withGrant) throws HiveAuthzPluginException { SQLPrivTypeGrant privType = SQLPrivTypeGrant.getSQLPrivTypeGrant(priv, withGrant); addPrivilege(privType); privilegeGrantSet.add(privType); if(withGrant){ //as with grant also implies without grant privilege, add without privilege as well addPrivilege(priv, false); } }