Changeset 1092 for trunk/grails-app/controllers
- Timestamp:
- Nov 5, 2010, 9:02:01 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/nmc/PilotController.groovy
r1049 r1092 39 39 def index = { 40 40 41 session.pilot = true 42 43 def user = authenticationService.getLoggedInUser() 44 def max = Math.min(params.max ? params.int('max') : 10, 100) 45 46 def c = Study.createCriteria() 47 48 def studies 49 if( user == null ) { 50 //login and return here... 51 redirect(controller:"login", action:"auth") 52 return false 53 54 } else { 55 studies = c.list { 56 maxResults(max) 57 or { 58 eq( "owner", user ) 59 writers { 60 eq( "id", user.id ) 61 } 62 and { 63 readers { 64 eq( "id", user.id ) 65 } 66 eq( "published", true ) 67 } 68 } 69 } 70 } 71 41 72 def studyInstance = new Study() 42 73 studyInstance.properties = params 43 74 44 [studyInstanceList: Study.list(params), studyInstance: studyInstance]75 [studyInstanceList: studies, studyInstance: studyInstance] 45 76 } 46 77
Note: See TracChangeset
for help on using the changeset viewer.