Changeset 1222 for trunk/grails-app/controllers/dbnp
- Timestamp:
- Nov 30, 2010, 2:10:42 PM (12 years ago)
- Location:
- trunk/grails-app/controllers/dbnp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/exporter/ExporterController.groovy
r1220 r1222 45 45 def c = dbnp.studycapturing.Study.createCriteria() 46 46 47 def studies 48 if( user == null ) { 49 studies = c.list { 50 maxResults(max) 51 and { 52 eq( "published", true ) 53 eq( "publicstudy", true ) 54 } 55 } 56 } else { 57 studies = c.list { 58 maxResults(max) 59 or { 60 eq( "owner", user ) 61 writers { 62 eq( "id", user.id ) 63 } 64 and { 65 readers { 66 eq( "id", user.id ) 67 } 68 eq( "published", true ) 69 } 70 } 71 } 72 } 47 def studies = Study.giveReadableStudies(user, max); 73 48 [studyInstanceList: studies, studyInstanceTotal: studies.count()] 74 49 } -
trunk/grails-app/controllers/dbnp/studycapturing/StudyController.groovy
r1213 r1222 3 3 import grails.converters.* 4 4 import grails.plugins.springsecurity.Secured 5 6 5 7 6 /** … … 25 24 def max = Math.min(params.max ? params.int('max') : 10, 100) 26 25 27 def c = Study.createCriteria() 28 29 def studies 30 if( user == null ) { 31 studies = c.list { 32 maxResults(max) 33 and { 34 eq( "published", true ) 35 eq( "publicstudy", true ) 36 } 37 } 38 } else { 39 studies = c.list { 40 maxResults(max) 41 or { 42 eq( "owner", user ) 43 writers { 44 eq( "id", user.id ) 45 } 46 and { 47 readers { 48 eq( "id", user.id ) 49 } 50 eq( "published", true ) 51 } 52 } 53 } 54 } 55 26 def studies = Study.giveReadableStudies( user, max ); 27 56 28 [studyInstanceList: studies, studyInstanceTotal: studies.count(), loggedInUser: user] 57 29 }
Note: See TracChangeset
for help on using the changeset viewer.