Changeset 976 for trunk/grails-app/conf
- Timestamp:
- Oct 21, 2010, 5:28:04 PM (10 years ago)
- Location:
- trunk/grails-app/conf
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/BaseFilters.groovy
r776 r976 29 29 } 30 30 } 31 31 32 } 32 33 } -
trunk/grails-app/conf/BootStrap.groovy
r939 r976 6 6 import org.codehaus.groovy.grails.commons.GrailsApplication 7 7 import grails.util.GrailsUtil 8 import org.nmcdsp.plugins.aaaa.SecUser8 import dbnp.authentication.* 9 9 10 10 … … 26 26 System.setProperty('user.timezone', 'CET') 27 27 28 def user = SecUser.findByUsername('user') ?: new SecUser( 28 def adminRole = SecRole.findByAuthority( 'ROLE_ADMIN' ) ?: new SecRole( authority: 'ROLE_ADMIN' ).save() 29 30 def user = SecUser.findByUsername('user') ?: new SecUser( 29 31 username: 'user', 30 password: springSecurityService.encodePassword('useR123!'), 31 enabled: true).save(failOnError: true) 32 password: springSecurityService.encodePassword( 'useR123!', 'user' ), 33 email: 'user@dbnp.org', 34 userConfirmed: true, adminConfirmed: true).save(failOnError: true) 32 35 33 36 def userAdmin = SecUser.findByUsername('admin') ?: new SecUser( 34 37 username: 'admin', 35 password: springSecurityService.encodePassword('admiN123!'), 36 enabled: true).save(failOnError: true) 38 password: springSecurityService.encodePassword( 'admiN123!', 'admin' ), 39 email: 'admin@dbnp.org', 40 userConfirmed: true, adminConfirmed: true).save(failOnError: true) 41 42 // Make the admin user an administrator 43 SecUserSecRole.create userAdmin, adminRole, true 37 44 38 45 def userTest = SecUser.findByUsername('test') ?: new SecUser( 39 46 username: 'test', 40 password: springSecurityService.encodePassword('testT123!'), 41 enabled: true).save(failOnError: true) 42 43 println "Done with SpringSecurity bootstrap, created [user, admin, test]." 47 password: springSecurityService.encodePassword( 'useR123!', 'test' ), 48 email: 'test@dbnp.org', 49 userConfirmed: true, adminConfirmed: true).save(failOnError: true) 50 51 println "Done with SpringSecurity bootstrap, created [user, admin, test]." 44 52 45 53 // If there are no templates yet in the database … … 81 89 } else { 82 90 // general study boostrapping 83 BootStrapStudies.addExampleStudies(user )91 BootStrapStudies.addExampleStudies(user, userAdmin) 84 92 } 85 93 } -
trunk/grails-app/conf/BootStrapStudies.groovy
r948 r976 21 21 */ 22 22 23 public static void addExampleStudies( org.nmcdsp.plugins.aaaa.SecUser owner) {23 public static void addExampleStudies(dbnp.authentication.SecUser owner, dbnp.authentication.SecUser otherUser ) { 24 24 25 25 // Look up the used ontologies which should be in the database by now … … 171 171 ecCode:"2007117.c", 172 172 startDate: Date.parse('yyyy-MM-dd','2008-01-02'), 173 owner: owner 173 owner: owner, 174 readers: [otherUser] 174 175 ).with { if (!validate()) { errors.each { println it} } else save()} 175 176 … … 378 379 ecCode:"unknown", 379 380 startDate: Date.parse('yyyy-MM-dd','2008-01-14'), 380 owner: owner 381 owner: owner, 382 writers: [otherUser] 381 383 ) 382 384 .setFieldValue( 'Description', "Human study performed at RRI; centres involved: RRI, IFR, TUM, Maastricht U." ) -
trunk/grails-app/conf/Config.groovy
r936 r976 157 157 158 158 // Needed for the Spring Security Core plugin: 159 grails.plugins.springsecurity.userLookup.userDomainClassName = 'org.nmcdsp.plugins.aaaa.SecUser' 160 grails.plugins.springsecurity.userLookup.authorityJoinClassName = 'org.nmcdsp.plugins.aaaa.SecUserSecRole' 161 grails.plugins.springsecurity.authority.className = 'org.nmcdsp.plugins.aaaa.SecRole' 159 grails.plugins.springsecurity.userLookup.userDomainClassName = 'dbnp.authentication.SecUser' 160 grails.plugins.springsecurity.userLookup.authorityJoinClassName = 'dbnp.authentication.SecUserSecRole' 161 grails.plugins.springsecurity.authority.className = 'dbnp.authentication.SecRole' 162 grails.plugins.springsecurity.password.algorithm = 'SHA-256' 163 grails.plugins.springsecurity.password.encodeHashAsBase64 = true 164 grails.plugins.springsecurity.dao.reflectionSaltSourceProperty = 'username' // Use the persons username as salt for encryption 165 grails.plugins.springsecurity.securityConfigType = grails.plugins.springsecurity.SecurityConfigType.Annotation 166 167 // Make sure the different controllers provided by springsecurity.ui are only accessible by administrators 168 // NB: the RegisterController is used for forgotten passwords. It should be accessible by anyone 169 grails.plugins.springsecurity.controllerAnnotations.staticRules = [ 170 '/user/**': ['ROLE_ADMIN'], 171 '/role/**': ['ROLE_ADMIN'], 172 '/aclclass/**': ['ROLE_ADMIN'], 173 '/aclentry/**': ['ROLE_ADMIN'], 174 '/aclobjectidentity/**': ['ROLE_ADMIN'], 175 '/aclsid/**': ['ROLE_ADMIN'], 176 '/persistentlogin/**': ['ROLE_ADMIN'], 177 '/registrationcode/**': ['ROLE_ADMIN'], 178 '/requestmap/**': ['ROLE_ADMIN'], 179 '/securityinfo/**': ['ROLE_ADMIN'] 180 ] 181 182 183 // Needed for sending emails 184 grails { 185 mail { 186 host = "smtp.gmail.com" 187 port = 465 188 username = "gscfproject@gmail.com" 189 password = "gscf2010" 190 props = [ 191 "mail.smtp.auth":"true", 192 "mail.smtp.socketFactory.port": '465', 193 "mail.smtp.socketFactory.class": "javax.net.ssl.SSLSocketFactory", 194 "mail.smtp.socketFactory.fallback": "false" 195 ] 196 } 197 } 162 198 163 199 // The OAuth consumer key and secret variables are currently replaced by Jeroen's Continuous Integration script. … … 173 209 } 174 210 } 211
Note: See TracChangeset
for help on using the changeset viewer.