Permalink
Browse files

Merge pull request #193 from TNO/master

Merge TNO master into PhenotypeFoundation master
  • Loading branch information...
ferryjagers committed Oct 12, 2018
2 parents 882ddca + dfe3699 commit 8a486d3e332014cb2feb569b206fbb46564d0eb6
@@ -2,4 +2,4 @@
#Sat Jan 05 12:13:45 CET 2013
app.grails.version=2.5.6
app.name=gscf
app.version=2.1.1
app.version=2.1.2
@@ -14,8 +14,8 @@
grails.project.fork = [
test: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, daemon:true], // configure settings for the test-app JVM
run: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256], // configure settings for the run-app JVM
war: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256], // configure settings for the run-war JVM
run: [maxMemory: 4560, minMemory: 64, debug: false, maxPerm: 256], // configure settings for the run-app JVM
war: [maxMemory: 4560, minMemory: 64, debug: false, maxPerm: 256], // configure settings for the run-war JVM
console: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256]// configure settings for the Console UI JVM
]
@@ -115,19 +115,22 @@ grails.plugin.springsecurity.securityConfigType = grails.plugin.springsecurity.S
grails.plugin.springsecurity.interceptUrlMap = [
'/*': ['permitAll'],
'/home/gotoStudy/*': ['IS_AUTHENTICATED_REMEMBERED'],
'/home/**': ['permitAll'],
'/study/**': ['permitAll'],
'/study/**': ['permitAll'],
'/publication/list': ['permitAll'],
'/assets/**': ['permitAll'],
'/**/js/**': ['permitAll'],
'/login/**': ['permitAll'],
'/logout/**': ['permitAll'],
'/downloads/**': ['permitAll'],
'/error/**': ['permitAll'],
'/assets/**': ['permitAll'],
'/**/js/**': ['permitAll'],
'/**/css/**': ['permitAll'],
'/**/images/**': ['permitAll'],
'/**/favicon.ico': ['permitAll'],
'/login/**': ['permitAll'],
'/logout/**': ['permitAll'],
'/downloads/**': ['permitAll'],
'/error/**': ['permitAll'],
'/info': ['permitAll'],
// Registration and confirming new accounts
'/register/forgotPassword': ['permitAll'],
@@ -168,7 +171,7 @@ grails.plugin.springsecurity.interceptUrlMap = [
'/userRegistration/confirmAdmin': ['ROLE_ADMIN', 'isFullyAuthenticated()'],
// All other urls are allowed for logged in users
'/**': ['IS_AUTHENTICATED_REMEMBERED']
'/**': ['IS_AUTHENTICATED_REMEMBERED'],
]
@@ -186,6 +186,11 @@ class HomeController {
}
}
def gotoStudy = {
redirect(controller: "study", action: "show", id: params.id)
return
}
// /**
// * Log the user in as admin and jump to the setup wizard
// */
@@ -850,13 +850,23 @@ class ApiController {
def featureMap = [ "name": table, "entityType": "Participant", "variables": [ ] ]
featureMap['variables'] << ["name":"subjectName","entityType":"Participant","valueType":"text","isRepeatable":false,"attributes":[["name":"label","value":"Subject name","locale":"en"]]]
featureMap['variables'] << ["name":"eventGroupName","entityType":"Participant","valueType":"text","isRepeatable":false,"attributes":[["name":"label","value":"EventGroup name","locale":"en"]]]
featureMap['variables'] << ["name":"subjectEventGroupStartTime","entityType":"Participant","valueType":"text","isRepeatable":false,"attributes":[["name":"label","value":"SubjectEventGroup start time","locale":"en"]]]
featureMap['variables'] << ["name":"subjectEventGroupDuration","entityType":"Participant","valueType":"text","isRepeatable":false,"attributes":[["name":"label","value":"SubjectEventGroup duration","locale":"en"]]]
featureMap['variables'] << ["name":"sampleRelativeStartTime","entityType":"Participant","valueType":"text","isRepeatable":false,"attributes":[["name":"label","value":"Sample relative start time","locale":"en"]]]
featureMap['variables'] << ["name":"design_information_eventGroupName","entityType":"Participant","valueType":"text","isRepeatable":false,"attributes":[["name":"label","value":"EventGroup name","locale":"en"]]]
featureMap['variables'] << ["name":"design_information_subjectEventGroupStartTime","entityType":"Participant","valueType":"text","isRepeatable":false,"attributes":[["name":"label","value":"SubjectEventGroup start time","locale":"en"]]]
featureMap['variables'] << ["name":"design_information_subjectEventGroupDuration","entityType":"Participant","valueType":"text","isRepeatable":false,"attributes":[["name":"label","value":"SubjectEventGroup duration","locale":"en"]]]
featureMap['variables'] << ["name":"design_information_sampleRelativeStartTime","entityType":"Participant","valueType":"text","isRepeatable":false,"attributes":[["name":"label","value":"Sample relative start time","locale":"en"]]]
def header = "ID,subjectName,eventGroupName,subjectEventGroupStartTime,subjectEventGroupDuration,sampleRelativeStartTime"
(subjectTemplateFieldNameList+featureNameList).each() { name ->
subjectTemplateFieldNameList.each() { name ->
// Opal & Datashield have some requirements for variable names
def opalName = "subject_information_"+name.replace("(","_").replace(")","").replace(":","_").replace("/","_").replace(",","_")
header += ",${opalName}".toString()
featureMap['variables'] << [ "name": opalName, "entityType": "Participant", "valueType": variableTypeMap[name], "isRepeatable": false, "attributes": [ [ "name": "label", "value": name, "locale": "en" ] ] ]
}
featureNameList.each() { name ->
// Opal & Datashield have some requirements for variable names
def opalName = name.replace("(","_").replace(")","").replace(":","_").replace("/","_").replace(",","_")
@@ -865,6 +875,7 @@ class ApiController {
featureMap['variables'] << [ "name": opalName, "entityType": "Participant", "valueType": variableTypeMap[name], "isRepeatable": false, "attributes": [ [ "name": "label", "value": name, "locale": "en" ] ] ]
}
header += "\n"
opalDataImport << header
@@ -20,7 +20,6 @@ class ErrorController {
def notFound = {
// substract shortCode from original request uri
def studyId
def shortCode = request.forwardURI.replace("${request.contextPath}/", "")
if ( shortCode ) {
@@ -29,23 +28,29 @@ class ErrorController {
if ( study ) {
def studyId
if ( study.publicstudy ) {
studyId = study.id
}
else {
SecUser user = authenticationService.getLoggedInUser()
if ( user ) {
if (study.canRead(user) ) {
studyId = study.id
}
// User will see study or get 'unauthorized' message
studyId = study.id
}
else {
// User will be asked to sign in
redirect(controller: "home", action: "gotoStudy", id: study.id )
return
}
}
}
if (studyId) {
redirect(controller: "study", action: "show", id: studyId)
return
if ( studyId ) {
redirect(controller: "study", action: "show", id: studyId)
return
}
}
}

0 comments on commit 8a486d3

Please sign in to comment.