Changeset 1521


Ignore:
Timestamp:
Feb 14, 2011, 4:49:54 PM (6 years ago)
Author:
robert@…
Message:

Changes in samplesearch test related to #313

Location:
trunk
Files:
4 added
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/conf/BootStrap.groovy

    r1519 r1521  
     1
     2
    13import dbnp.authentication.SecRole
    24import dbnp.authentication.SecUser
     
    911import dbnp.rest.common.CommunicationManager
    1012import org.codehaus.groovy.grails.commons.*
     13import dbnp.configuration.*
    1114
    1215/**
  • trunk/grails-app/conf/dbnp/configuration/BootStrapTemplates.groovy

    r1520 r1521  
    88 * $Date$
    99 */
     10package dbnp.configuration
     11
    1012
    1113import dbnp.studycapturing.*
  • trunk/src/groovy/dbnp/query/SampleSearch.groovy

    r1501 r1521  
    7676                def samples = []
    7777                if( getEntityCriteria( 'Study' ).size() > 0 ) {
    78                         def studies = Study.findAll().findAll { it.canRead( this.user ) };
     78                        def studies = Study.list()
     79                        if( studies )
     80                                studies = studies.findAll { it.canRead( this.user ) };
    7981
    8082                        studies = filterStudiesOnStudyCriteria( studies );
     
    98100                        });
    99101                } else {
    100                         samples = Sample.findAll().findAll { it.parent?.canRead( this.user ) }
     102                        samples = Sample.list()
     103                        if( samples )
     104                                samples = samples.findAll { it.parent?.canRead( this.user ) }
    101105                }
    102106
  • trunk/test/integration/dbnp/query/SampleSearchTests.groovy

    r1520 r1521  
    33import dbnp.authentication.SecUser
    44import dbnp.studycapturing.*
     5import dbnp.configuration.*
    56
    67/**
     
    116117//              session.flush();
    117118//              session.clear();
    118 
     119               
     120                BootStrapTemplates.initTemplateOntologies();
     121                BootStrapTemplates.initTemplates()
     122                BootStrapStudies.addExampleStudies(SecUser.findByUsername('user'), SecUser.findByUsername('admin'))
    119123    }
    120124
Note: See TracChangeset for help on using the changeset viewer.