fe/src/main/java/com/cloudera/impala/authorization/AuthorizationChecker.java
/*
   * Returns true if the given user has permission to execute the given
   * request, false otherwise. Always returns true if authorization is disabled.
   */
Returns true if the given user has permission to execute the given
request, false otherwise. Always returns true if authorization is disabled.
Returns true if the given user has permission to execute the given request false otherwise . Always returns true if authorization is disabled .
public boolean hasAccess(User user, PrivilegeRequest request) {
    Preconditions.checkNotNull(user);
    Preconditions.checkNotNull(request);
    if (!config_.isEnabled() || user instanceof ImpalaInternalAdminUser) {
      return true;
    }
    EnumSet<org.apache.sentry.core.Action> actions =
        request.getPrivilege().getHiveActions();
    List<Authorizable> authorizeables = Lists.newArrayList();
    authorizeables.add(new org.apache.sentry.core.Server(config_.getServerName()));
    if (request.getAuthorizeable() != null) {
      authorizeables.addAll(request.getAuthorizeable().getHiveAuthorizeableHierarchy());
    }
    if (request.getPrivilege().getAnyOf()) {
      for (org.apache.sentry.core.Action action: actions) {
        if (provider_.hasAccess(new org.apache.sentry.core.Subject(user.getShortName()),
            authorizeables, EnumSet.of(action))) {
          return true;
        }
      }
      return false;
    }
    return provider_.hasAccess(new org.apache.sentry.core.Subject(user.getShortName()),
        authorizeables, actions);
  }
public boolean hasAccess ( User user , PrivilegeRequest request ) { Preconditions . checkNotNull ( user ) ; Preconditions . checkNotNull ( request ) ; if ( ! config_ . isEnabled ( ) || user instanceof ImpalaInternalAdminUser ) { return true ; } EnumSet < org . apache . sentry . core . Action > actions = request . getPrivilege ( ) . getHiveActions ( ) ; List < Authorizable > authorizeables = Lists . newArrayList ( ) ; authorizeables . add ( new org . apache . sentry . core . Server ( config_ . getServerName ( ) ) ) ; if ( request . getAuthorizeable ( ) != null ) { authorizeables . addAll ( request . getAuthorizeable ( ) . getHiveAuthorizeableHierarchy ( ) ) ; } if ( request . getPrivilege ( ) . getAnyOf ( ) ) { for ( org . apache . sentry . core . Action action : actions ) { if ( provider_ . hasAccess ( new org . apache . sentry . core . Subject ( user . getShortName ( ) ) , authorizeables , EnumSet . of ( action ) ) ) { return true ; } } return false ; } return provider_ . hasAccess ( new org . apache . sentry . core . Subject ( user . getShortName ( ) ) , authorizeables , actions ) ; }
Returns true if the given user has permission to execute the given
 request, false otherwise.
Returns true if the given user has permission to execute the given request false otherwise .
// If authorization is not enabled the user will always have access. If this is // an internal request, the user will always have permission. // If request.getAuthorizeable() is null, the request is for server-level permission. // The Hive Access API does not currently provide a way to check if the user // has any privileges on a given resource.