source: trunk/grails-app/conf/BootStrap.groovy

Last change on this file was 63, checked in by robert@…, 12 years ago

Improved querying (#40)

  • Removed continuous synchronization while importing data
  • Added action buttons to search result screen
  • Implemented authorization checks while searching
File size: 700 bytes
Line 
1import nl.tno.massSequencing.auth.*;
2import nl.tno.massSequencing.AssaySample;
3
4class BootStrap {       
5        def trashService
6       
7    def init = { servletContext ->
8                // Create trashcan if needed
9                if( !trashService.giveTrashcan() )
10                        trashService.createTrashcan(); 
11               
12                // Create authorization for the trashcan, if needed
13                def admin = User.findByUsername( "admin" );
14                if( admin ) {
15                        def trash = trashService.giveTrashcan();
16                        if( !trash.canRead( admin ) ) {
17                                trashService.setupAuthorization( trash, admin );
18                        }
19                }
20               
21                // Recalculate sequence totals per assaysample, because they might have not
22                // been calculated before
23                AssaySample.recalculateNumSequences()
24    }
25    def destroy = {
26    }
27}
Note: See TracBrowser for help on using the repository browser.