Last change
on this file since 24 was
22,
checked in by robert@…, 11 years ago
|
Implemented authorization checks on file downloads
|
File size:
507 bytes
|
Line | |
---|
1 | import nl.tno.metagenomics.auth.*; |
---|
2 | |
---|
3 | class BootStrap { |
---|
4 | def trashService |
---|
5 | |
---|
6 | def init = { servletContext -> |
---|
7 | // Create trashcan if needed |
---|
8 | if( !trashService.giveTrashcan() ) |
---|
9 | trashService.createTrashcan(); |
---|
10 | |
---|
11 | // Create authorization for the trashcan, if needed |
---|
12 | def admin = User.findByUsername( "admin" ); |
---|
13 | if( admin ) { |
---|
14 | def trash = trashService.giveTrashcan(); |
---|
15 | if( !trash.canRead( admin ) ) { |
---|
16 | trashService.setupAuthorization( trash, admin ); |
---|
17 | } |
---|
18 | } |
---|
19 | } |
---|
20 | def destroy = { |
---|
21 | } |
---|
22 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.