Examples of HivePrivilegeObject


Examples of org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject

        break;
        default:
          throw new AssertionError("Unexpected object type");
      }

      HivePrivilegeObject hPrivObject = new HivePrivilegeObject(privObjType, dbname, tableURI);
      hivePrivobjs.add(hPrivObject);
    }
    return hivePrivobjs;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject

          getHivePrivilegeObject(showGrantDesc.getHiveObj())
          );
      List<HiveObjectPrivilege> privList = new ArrayList<HiveObjectPrivilege>();
      for(HivePrivilegeInfo privInfo : privInfos){
        HivePrincipal principal = privInfo.getPrincipal();
        HivePrivilegeObject privObj = privInfo.getObject();
        HivePrivilege priv = privInfo.getPrivilege();

        PrivilegeGrantInfo grantInfo =
            AuthorizationUtils.getThriftPrivilegeGrantInfo(priv, privInfo.getGrantorPrincipal(),
                privInfo.isGrantOption(), privInfo.getGrantTime());

        //only grantInfo is used
        HiveObjectPrivilege thriftObjectPriv = new HiveObjectPrivilege(new HiveObjectRef(
            AuthorizationUtils.getThriftHiveObjType(privObj.getType()),privObj.getDbname(),
            privObj.getTableViewURI(),null,null), principal.getName(),
            AuthorizationUtils.getThriftPrincipalType(principal.getType()), grantInfo);
        privList.add(thriftObjectPriv);
      }
      boolean testMode = conf.getBoolVar(HiveConf.ConfVars.HIVE_IN_TEST);
      writeToFile(writeGrantInfo(privList, testMode), showGrantDesc.getResFile());
View Full Code Here

Examples of org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject

    HiveAuthorizer authorizer = SessionState.get().getAuthorizerV2();

    //Convert to object types used by the authorization plugin interface
    List<HivePrincipal> hivePrincipals = getHivePrincipals(principals);
    List<HivePrivilege> hivePrivileges = getHivePrivileges(privileges);
    HivePrivilegeObject hivePrivObject = getHivePrivilegeObject(privSubjectDesc);
    HivePrincipal grantorPrincipal = new HivePrincipal(grantor, getHivePrincipalType(grantorType));

    if(isGrant){
      authorizer.grantPrivileges(hivePrincipals, hivePrivileges, hivePrivObject,
          grantorPrincipal, grantOption);
View Full Code Here

Examples of org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject

  private HivePrivilegeObject getHivePrivilegeObject(PrivilegeObjectDesc privSubjectDesc)
      throws HiveException {

    String [] dbTable = Utilities.getDbTableName(privSubjectDesc.getObject());
    return new HivePrivilegeObject(getPrivObjectType(privSubjectDesc), dbTable[0], dbTable[1]);
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject

        PrivilegeGrantInfo msGrantInfo = msObjPriv.getGrantInfo();
        HivePrivilege resPrivilege = new HivePrivilege(msGrantInfo.getPrivilege(), null);

        // result object
        HiveObjectRef msObjRef = msObjPriv.getHiveObject();
        HivePrivilegeObject resPrivObj = new HivePrivilegeObject(
            getPluginObjType(msObjRef.getObjectType()), msObjRef.getDbName(),
            msObjRef.getObjectName());

        // result grantor principal
        HivePrincipal grantorPrincipal = new HivePrincipal(msGrantInfo.getGrantor(),
View Full Code Here

Examples of org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject

          getHivePrivilegeObject(showGrantDesc.getHiveObj())
          );
      List<HiveObjectPrivilege> privList = new ArrayList<HiveObjectPrivilege>();
      for(HivePrivilegeInfo privInfo : privInfos){
        HivePrincipal principal = privInfo.getPrincipal();
        HivePrivilegeObject privObj = privInfo.getObject();
        HivePrivilege priv = privInfo.getPrivilege();

        PrivilegeGrantInfo grantInfo =
            AuthorizationUtils.getThriftPrivilegeGrantInfo(priv, privInfo.getGrantorPrincipal(),
                privInfo.isGrantOption(), privInfo.getGrantTime());

        //only grantInfo is used
        HiveObjectPrivilege thriftObjectPriv = new HiveObjectPrivilege(new HiveObjectRef(
            AuthorizationUtils.getThriftHiveObjType(privObj.getType()),privObj.getDbname(),
            privObj.getTableViewURI(),null,null), principal.getName(),
            AuthorizationUtils.getThriftPrincipalType(principal.getType()), grantInfo);
        privList.add(thriftObjectPriv);
      }
      boolean testMode = conf.getBoolVar(HiveConf.ConfVars.HIVE_IN_TEST);
      writeToFile(writeGrantInfo(privList, testMode), showGrantDesc.getResFile());
View Full Code Here

Examples of org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject

    HiveAuthorizer authorizer = SessionState.get().getAuthorizerV2();

    //Convert to object types used by the authorization plugin interface
    List<HivePrincipal> hivePrincipals = getHivePrincipals(principals);
    List<HivePrivilege> hivePrivileges = getHivePrivileges(privileges);
    HivePrivilegeObject hivePrivObject = getHivePrivilegeObject(privSubjectDesc);
    HivePrincipal grantorPrincipal = new HivePrincipal(grantor, getHivePrincipalType(grantorType));

    if(isGrant){
      authorizer.grantPrivileges(hivePrincipals, hivePrivileges, hivePrivObject,
          grantorPrincipal, grantOption);
View Full Code Here

Examples of org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject

  private HivePrivilegeObject getHivePrivilegeObject(PrivilegeObjectDesc privSubjectDesc)
      throws HiveException {

    String [] dbTable = Utilities.getDbTableName(privSubjectDesc.getObject());
    return new HivePrivilegeObject(getPrivObjectType(privSubjectDesc), dbTable[0], dbTable[1]);
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject

        continue;
        default:
          throw new AssertionError("Unexpected object type");
      }

      HivePrivilegeObject hPrivObject = new HivePrivilegeObject(privObjType, dbname, tableURI);
      hivePrivobjs.add(hPrivObject);
    }
    return hivePrivobjs;
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject

        continue;
        default:
          throw new AssertionError("Unexpected object type");
      }
      HivePrivObjectActionType actionType = AuthorizationUtils.getActionType(privObject);
      HivePrivilegeObject hPrivObject = new HivePrivilegeObject(privObjType, dbname, objName,
          partKeys, columns, actionType, null);
      hivePrivobjs.add(hPrivObject);
    }
    return hivePrivobjs;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.