Changeset 908

Show
Ignore:
Timestamp:
04-10-10 12:09:44 (4 years ago)
Author:
tabma
Message:

-added Authorization-method to REST-controller

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/RestController.groovy

    r906 r908  
    280280                render items as JSON 
    281281        } 
     282 
     283        /** 
     284        * REST resource for dbNP modules. 
     285        * 
     286        * @param studyToken String, the external identifier of the study 
     287        * @return List of all fields of this study 
     288        * @return 
     289        * 
     290        * Example REST call (without authentication): 
     291        * http://localhost:8080/gscf/rest/getStudy/study?studyToken=PPSH 
     292        * 
     293        * Returns the JSON object: 
     294        * {"title":"NuGO PPS human study","studyToken":"PPSH","startDate":"2008-01-13T23:00:00Z", 
     295        * "Description":"Human study performed at RRI; centres involved: RRI, IFR, TUM, Maastricht U.", 
     296        * "Objectives":null,"Consortium":null,"Cohort name":null,"Lab id":null,"Institute":null, 
     297        * "Study protocol":null} 
     298        */ 
     299        def getAuthorizationLevel = { 
     300                def items = [:] 
     301                /*if( params.studyToken ) { 
     302                        def study = Study.find( "from Study as s where code=?",[params.studyToken]) 
     303                         
     304                } 
     305                render items as JSON*/ 
     306        } 
    282307}