@Override
  public Collection<? extends GrantedAuthority> getGrantedAuthorities(DirContextOperations userData, String username) {
    username = AuthorizationHelper.resolveLoginAliasToUserName(username);

    log.info("Get authorities for user " + username + " from local DB");

    UserEntity user;

    user = userDAO.findUserByName(username);
    
    if (user == null) {
      log.error("Can't get authorities for user " + username + ", he is not present in local DB");
      return Collections.emptyList();
    }
    if(!user.getActive()){
      throw new InvalidUsernamePasswordCombinationException(username);
    }

    Collection<PrivilegeEntity> privilegeEntities = users.getUserPrivileges(user);

    return authorizationHelper.convertPrivilegesToAuthorities(privilegeEntities);
  }
Provides authorities population for LDAP user from LDAP catalog
ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapAuthoritiesPopulator.java