Project

General

Profile

« Previous | Next » 

Revision 9331

include isPublic criteria when there is a public subject (which is always)

View differences:

metacat-common/src/main/java/edu/ucsb/nceas/metacat/common/query/SolrQueryService.java
49 49
    protected static final String FILTERQUERY = "fq";
50 50
    protected static final String UNKNOWN = "Unknown";
51 51
    private static final String READPERMISSION = "readPermission";
52
    private static final String IS_PUBLIC = "isPublic";
52 53
    private static final String RIGHTSHOLDER = "rightsHolder";
53 54
    private static final String OPENPARENTHESE = "(";
54 55
    private static final String CLOSEPARENTHESE = ")";
......
177 178
                            query.append(OPENPARENTHESE+READPERMISSION+COLON+"\""+subjectName+"\""+CLOSEPARENTHESE);
178 179
                            if(!subjectName.equals(Constants.SUBJECT_PUBLIC) && !subjectName.equals(Constants.SUBJECT_AUTHENTICATED_USER)) {
179 180
                                query.append(OR+OPENPARENTHESE+RIGHTSHOLDER+COLON+"\""+subjectName+"\""+CLOSEPARENTHESE);
181
                            } else if (subjectName.equals(Constants.SUBJECT_PUBLIC) {
182
                                query.append(OR+OPENPARENTHESE+IS_PUBLIC+COLON+"true"+CLOSEPARENTHESE);
180 183
                            }
181 184
                        } else {
182 185
                            query.append(OR + OPENPARENTHESE+READPERMISSION+COLON+"\""+subjectName+"\""+CLOSEPARENTHESE);
183 186
                            if(!subjectName.equals(Constants.SUBJECT_PUBLIC) && !subjectName.equals(Constants.SUBJECT_AUTHENTICATED_USER)) {
184 187
                                query.append(OR + OPENPARENTHESE+RIGHTSHOLDER+COLON+"\""+subjectName+"\""+CLOSEPARENTHESE);
188
                            } else if (subjectName.equals(Constants.SUBJECT_PUBLIC) {
189
                                query.append(OR+OPENPARENTHESE+IS_PUBLIC+COLON+"true"+CLOSEPARENTHESE);
185 190
                            }
186 191
                        }
187 192
                    }
188
                   
189 193
                }
190 194
               
191 195
            }

Also available in: Unified diff