org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd
Class SQLStdHiveAccessController

java.lang.Object
  extended by org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAccessController
All Implemented Interfaces:
HiveAccessController

@InterfaceAudience.Private
public class SQLStdHiveAccessController
extends Object
implements HiveAccessController

Implements functionality of access control statements for sql standard based authorization


Field Summary
static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
SQLStdHiveAccessController(HiveMetastoreClientFactory metastoreClientFactory, HiveConf conf, HiveAuthenticationProvider authenticator)
           
 
Method Summary
 void applyAuthorizationConfigPolicy(HiveConf hiveConf)
           
 void createRole(String roleName, HivePrincipal adminGrantor)
           
 void dropRole(String roleName)
           
 List<String> getAllRoles()
           
 List<String> getCurrentRoleNames()
           
 List<HiveRoleGrant> getCurrentRoles()
           
 List<HiveRoleGrant> getPrincipalGrantInfoForRole(String roleName)
           
 List<HiveRoleGrant> getRoleGrantInfoForPrincipal(HivePrincipal principal)
           
 void grantPrivileges(List<HivePrincipal> hivePrincipals, List<HivePrivilege> hivePrivileges, HivePrivilegeObject hivePrivObject, HivePrincipal grantorPrincipal, boolean grantOption)
           
 void grantRole(List<HivePrincipal> hivePrincipals, List<String> roleNames, boolean grantOption, HivePrincipal grantorPrinc)
           
 void revokePrivileges(List<HivePrincipal> hivePrincipals, List<HivePrivilege> hivePrivileges, HivePrivilegeObject hivePrivObject, HivePrincipal grantorPrincipal, boolean grantOption)
           
 void revokeRole(List<HivePrincipal> hivePrincipals, List<String> roleNames, boolean grantOption, HivePrincipal grantorPrinc)
           
 void setCurrentRole(String roleName)
           
 List<HivePrivilegeInfo> showPrivileges(HivePrincipal principal, HivePrivilegeObject privObj)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG
Constructor Detail

SQLStdHiveAccessController

public SQLStdHiveAccessController(HiveMetastoreClientFactory metastoreClientFactory,
                                  HiveConf conf,
                                  HiveAuthenticationProvider authenticator)
                           throws HiveAuthzPluginException
Throws:
HiveAuthzPluginException
Method Detail

grantPrivileges

public void grantPrivileges(List<HivePrincipal> hivePrincipals,
                            List<HivePrivilege> hivePrivileges,
                            HivePrivilegeObject hivePrivObject,
                            HivePrincipal grantorPrincipal,
                            boolean grantOption)
                     throws HiveAuthzPluginException,
                            HiveAccessControlException
Specified by:
grantPrivileges in interface HiveAccessController
Throws:
HiveAuthzPluginException
HiveAccessControlException

getCurrentRoleNames

public List<String> getCurrentRoleNames()
                                 throws HiveAuthzPluginException
Specified by:
getCurrentRoleNames in interface HiveAccessController
Throws:
HiveAuthzPluginException

revokePrivileges

public void revokePrivileges(List<HivePrincipal> hivePrincipals,
                             List<HivePrivilege> hivePrivileges,
                             HivePrivilegeObject hivePrivObject,
                             HivePrincipal grantorPrincipal,
                             boolean grantOption)
                      throws HiveAuthzPluginException,
                             HiveAccessControlException
Specified by:
revokePrivileges in interface HiveAccessController
Throws:
HiveAuthzPluginException
HiveAccessControlException

createRole

public void createRole(String roleName,
                       HivePrincipal adminGrantor)
                throws HiveAuthzPluginException,
                       HiveAccessControlException
Specified by:
createRole in interface HiveAccessController
Throws:
HiveAuthzPluginException
HiveAccessControlException

dropRole

public void dropRole(String roleName)
              throws HiveAuthzPluginException,
                     HiveAccessControlException
Specified by:
dropRole in interface HiveAccessController
Throws:
HiveAuthzPluginException
HiveAccessControlException

grantRole

public void grantRole(List<HivePrincipal> hivePrincipals,
                      List<String> roleNames,
                      boolean grantOption,
                      HivePrincipal grantorPrinc)
               throws HiveAuthzPluginException,
                      HiveAccessControlException
Specified by:
grantRole in interface HiveAccessController
Throws:
HiveAuthzPluginException
HiveAccessControlException

revokeRole

public void revokeRole(List<HivePrincipal> hivePrincipals,
                       List<String> roleNames,
                       boolean grantOption,
                       HivePrincipal grantorPrinc)
                throws HiveAuthzPluginException,
                       HiveAccessControlException
Specified by:
revokeRole in interface HiveAccessController
Throws:
HiveAuthzPluginException
HiveAccessControlException

getAllRoles

public List<String> getAllRoles()
                         throws HiveAuthzPluginException,
                                HiveAccessControlException
Specified by:
getAllRoles in interface HiveAccessController
Throws:
HiveAuthzPluginException
HiveAccessControlException

getPrincipalGrantInfoForRole

public List<HiveRoleGrant> getPrincipalGrantInfoForRole(String roleName)
                                                 throws HiveAuthzPluginException,
                                                        HiveAccessControlException
Specified by:
getPrincipalGrantInfoForRole in interface HiveAccessController
Throws:
HiveAuthzPluginException
HiveAccessControlException

showPrivileges

public List<HivePrivilegeInfo> showPrivileges(HivePrincipal principal,
                                              HivePrivilegeObject privObj)
                                       throws HiveAuthzPluginException
Specified by:
showPrivileges in interface HiveAccessController
Throws:
HiveAuthzPluginException

setCurrentRole

public void setCurrentRole(String roleName)
                    throws HiveAccessControlException,
                           HiveAuthzPluginException
Specified by:
setCurrentRole in interface HiveAccessController
Throws:
HiveAccessControlException
HiveAuthzPluginException

getCurrentRoles

public List<HiveRoleGrant> getCurrentRoles()
                                    throws HiveAuthzPluginException
Throws:
HiveAuthzPluginException

getRoleGrantInfoForPrincipal

public List<HiveRoleGrant> getRoleGrantInfoForPrincipal(HivePrincipal principal)
                                                 throws HiveAuthzPluginException,
                                                        HiveAccessControlException
Specified by:
getRoleGrantInfoForPrincipal in interface HiveAccessController
Throws:
HiveAuthzPluginException
HiveAccessControlException

applyAuthorizationConfigPolicy

public void applyAuthorizationConfigPolicy(HiveConf hiveConf)
Specified by:
applyAuthorizationConfigPolicy in interface HiveAccessController


Copyright © 2014 The Apache Software Foundation. All rights reserved.