public boolean addAuthIndex(String userName,String indexName){
  if (userName == null || userName.equals("") || indexName == null || indexName.equals("")) {
    return false;
  }
  userName=userName.toLowerCase();
  indexName=indexName.toLowerCase();
  if (userName.equals("root")) {
    return false;
  }
  UserData user=getUser(userName);
  if (user == null) {
    return false;
  }
  Set<String> indexFilters=user.getIndexFilters();
  String[] indexNames=indexName.split(",");
  for (  String index : indexNames) {
    index=index.trim();
    if (index == null || index.equals("")) {
      continue;
    }
    if (index.charAt(0) != '/') {
      index="/" + index;
    }
    if (index.equals("/*")) {
      continue;
    }
    indexFilters.add(index);
  }
  user.setFilters(indexFilters);
  return putUser(user);
}

public boolean addAuthIndex ( String userName , String indexName ) { if ( userName == null || userName . equals ( "" ) || indexName == null || indexName . equals ( "" ) ) { return false ; } userName = userName . toLowerCase ( ) ; indexName = indexName . toLowerCase ( ) ; if ( userName . equals ( "root" ) ) { return false ; } UserData user = getUser ( userName ) ; if ( user == null ) { return false ; } Set < String > indexFilters = user . getIndexFilters ( ) ; String [ ] indexNames = indexName . split ( "," ) ; for ( String index : indexNames ) { index = index . trim ( ) ; if ( index == null || index . equals ( "" ) ) { continue ; } if ( index . charAt ( 0 ) != '/' ) { index = "/" + index ; } if ( index . equals ( "/*" ) ) { continue ; } indexFilters . add ( index ) ; } user . setFilters ( indexFilters ) ; return putUser ( user ) ; }
add permission to an user with specified indices
