Changeset 1222 for trunk/grails-app/controllers/nmc
- Timestamp:
- Nov 30, 2010, 2:10:42 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/nmc/PilotController.groovy
r1204 r1222 16 16 17 17 import dbnp.studycapturing.*; 18 import grails.plugins.springsecurity.Secured 19 18 20 19 21 class PilotController { … … 37 39 } 38 40 39 def index = { 41 @Secured(['IS_AUTHENTICATED_REMEMBERED']) 42 def index = { 40 43 41 44 session.pilot = true 42 45 43 46 def user = authenticationService.getLoggedInUser() 44 47 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 } 48 def studies = Study.giveReadableStudies(user, max); 71 49 72 50 def studyInstance = new Study()
Note: See TracChangeset
for help on using the changeset viewer.