Skip to content
This repository was archived by the owner on Jun 7, 2024. It is now read-only.

Commit cf7f798

Browse files
committed
preparing OLF for ELN functionality such as limited access to domain objects which is needed to limit access to notes effectively.
1 parent a07127f commit cf7f798

File tree

11 files changed

+90
-80
lines changed

11 files changed

+90
-80
lines changed

application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
app.grails.version=2.2.5
44
app.name=OpenLabFramework
55
app.servlet.version=2.4
6-
app.version=1.3.0
6+
app.version=1.3.2

grails-app/conf/BuildConfig.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ grails.project.dependency.resolution = {
4848

4949
}
5050
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
51-
repositories { l
51+
repositories {
5252
inherits true
5353
grailsPlugins()
5454
grailsHome()
@@ -75,6 +75,8 @@ grails.project.dependency.resolution = {
7575
compile "org.cloudfoundry:cloudfoundry-runtime:0.8.4"
7676
build 'org.bouncycastle:bcpg-jdk15on:1.50'
7777
build 'org.bouncycastle:bcprov-jdk15on:1.50'
78+
compile "org.docx4j:docx4j-ImportXHTML:3.2.2"
79+
compile "net.sf.jtidy:jtidy:r938"
7880
}
7981

8082
plugins{

grails-app/controllers/org/openlab/content/DashboardController.groovy

Lines changed: 48 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
1-
/*
2-
* Copyright (C) 2013
3-
* Center for Excellence in Nanomedicine (NanoCAN)
4-
* Molecular Oncology
5-
* University of Southern Denmark
6-
* ###############################################
7-
* Written by: Markus List
8-
* Contact: mlist'at'health'.'sdu'.'dk
9-
* Web: http://www.nanocan.org
10-
* ###########################################################################
11-
*
12-
* This file is part of OpenLabFramework.
13-
*
14-
* OpenLabFramework is free software: you can redistribute it and/or modify
15-
* it under the terms of the GNU General Public License as published by
16-
* the Free Software Foundation, either version 3 of the License, or
17-
* (at your option) any later version.
18-
*
19-
* This program is distributed in the hope that it will be useful,
20-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22-
* GNU General Public License for more details.
23-
*
24-
* You should have received a copy of the GNU General Public License
25-
* along with this program. It can be found at the root of the project page.
26-
* If not, see <http://www.gnu.org/licenses/>.
27-
*
28-
* ############################################################################
29-
*/
1+
/*
2+
* Copyright (C) 2013
3+
* Center for Excellence in Nanomedicine (NanoCAN)
4+
* Molecular Oncology
5+
* University of Southern Denmark
6+
* ###############################################
7+
* Written by: Markus List
8+
* Contact: mlist'at'health'.'sdu'.'dk
9+
* Web: http://www.nanocan.org
10+
* ###########################################################################
11+
*
12+
* This file is part of OpenLabFramework.
13+
*
14+
* OpenLabFramework is free software: you can redistribute it and/or modify
15+
* it under the terms of the GNU General Public License as published by
16+
* the Free Software Foundation, either version 3 of the License, or
17+
* (at your option) any later version.
18+
*
19+
* This program is distributed in the hope that it will be useful,
20+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+
* GNU General Public License for more details.
23+
*
24+
* You should have received a copy of the GNU General Public License
25+
* along with this program. It can be found at the root of the project page.
26+
* If not, see <http://www.gnu.org/licenses/>.
27+
*
28+
* ############################################################################
29+
*/
3030
package org.openlab.content
3131

32+
import org.hibernate.criterion.CriteriaSpecification
3233
import org.openlab.main.*;
3334
import org.openlab.security.*;
3435

@@ -58,13 +59,25 @@ class DashboardController {
5859
}
5960

6061
def lastModifiedMax = params.lastModifiedMax?:10
61-
62+
//get user
63+
def username = springSecurityService?.getPrincipal().username
64+
6265
//get last modified by anyone
63-
def lastModifiedByAny = DataObject.list(max: lastModifiedMax, sort: "lastUpdate", order: "desc")
64-
65-
//get user
66-
def username = springSecurityService?.getPrincipal().username
67-
66+
def lastModifiedByAny = DataObject.withCriteria {
67+
createAlias("shared", "sh", CriteriaSpecification.LEFT_JOIN)
68+
createAlias("creator", "cr", CriteriaSpecification.LEFT_JOIN)
69+
or{
70+
eq("cr.username", username)
71+
isNull("accessLevel")
72+
eq("accessLevel", "open")
73+
eq 'sh.username', username
74+
75+
}
76+
maxResults lastModifiedMax
77+
order "lastUpdate", "desc"
78+
}
79+
80+
6881
//get last modified by user
6982
def lastModifiedByUser = DataObject.withCriteria{
7083
lastModifier{

grails-app/controllers/org/openlab/datasource/DataSourceController.groovy

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
/*
2-
* Copyright (C) 2013
3-
* Center for Excellence in Nanomedicine (NanoCAN)
4-
* Molecular Oncology
5-
* University of Southern Denmark
6-
* ###############################################
7-
* Written by: Markus List
8-
* Contact: mlist'at'health'.'sdu'.'dk
9-
* Web: http://www.nanocan.org
10-
* ###########################################################################
11-
*
12-
* This file is part of OpenLabFramework.
13-
*
14-
* OpenLabFramework is free software: you can redistribute it and/or modify
15-
* it under the terms of the GNU General Public License as published by
16-
* the Free Software Foundation, either version 3 of the License, or
17-
* (at your option) any later version.
18-
*
19-
* This program is distributed in the hope that it will be useful,
20-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22-
* GNU General Public License for more details.
23-
*
24-
* You should have received a copy of the GNU General Public License
25-
* along with this program. It can be found at the root of the project page.
26-
* If not, see <http://www.gnu.org/licenses/>.
27-
*
28-
* ############################################################################
29-
*/
1+
/*
2+
* Copyright (C) 2013
3+
* Center for Excellence in Nanomedicine (NanoCAN)
4+
* Molecular Oncology
5+
* University of Southern Denmark
6+
* ###############################################
7+
* Written by: Markus List
8+
* Contact: mlist'at'health'.'sdu'.'dk
9+
* Web: http://www.nanocan.org
10+
* ###########################################################################
11+
*
12+
* This file is part of OpenLabFramework.
13+
*
14+
* OpenLabFramework is free software: you can redistribute it and/or modify
15+
* it under the terms of the GNU General Public License as published by
16+
* the Free Software Foundation, either version 3 of the License, or
17+
* (at your option) any later version.
18+
*
19+
* This program is distributed in the hope that it will be useful,
20+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+
* GNU General Public License for more details.
23+
*
24+
* You should have received a copy of the GNU General Public License
25+
* along with this program. It can be found at the root of the project page.
26+
* If not, see <http://www.gnu.org/licenses/>.
27+
*
28+
* ############################################################################
29+
*/
3030
package org.openlab.datasource
3131

3232
/**
@@ -46,7 +46,6 @@ class DataSourceController {
4646
{
4747
if (dataSource instanceof org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy) {
4848
def baseDataSource = dataSource.targetDataSource
49-
println baseDataSource.properties
5049
[url: baseDataSource.url, driverClassName: baseDataSource.driverClassName, username: baseDataSource.username]
5150
}
5251

grails-app/controllers/security/UserController.groovy

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,8 @@ class UserController {
134134
return
135135
}
136136

137-
def oldPassword = person.password
138137
person.properties = params
139-
if (!params.password.equals(oldPassword)) {
140-
person.password = springSecurityService.encodePassword(params.password)
141-
}
138+
142139
if (person.save()) {
143140
UserRole.removeAll(person)
144141
addRoles(person)
@@ -160,7 +157,6 @@ class UserController {
160157

161158
def person = new User()
162159
person.properties = params
163-
person.password = springSecurityService.encodePassword(params.password)
164160
params.bodyOnly = true
165161
if (person.save()) {
166162
addRoles(person)

grails-app/views/login/auth.gsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</head>
1414

1515
<body>
16-
<div id='login'>
16+
<div id='login' style="padding:50px;">
1717
<g:if test="${!mobile}">
1818
<div>
1919
<img src="<g:resource dir="images" file="welcome_logo.jpg"/>"/>

modules/OpenLabAttachments

modules/OpenLabBackend

modules/OpenLabNotes

src/templates/scaffolding/_additionalBoxes.gsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<% import grails.persistence.Event %>
22
<%=packageName%>
3-
<% excludedProps = Event.allEvents.toList() << 'version' << 'attachable' << 'id' << 'acl' %>
3+
<% excludedProps = Event.allEvents.toList() << 'version' << 'attachable' << 'id' << 'acl' << 'accessLevel' %>
44
<% historyProps = [] << 'creator' << 'dateCreated' << 'lastModifier' << 'lastUpdate' %>
55
<div style="padding-right:20px; padding-top: 20px; position:absolute; right:0;">
66
<% props = domainClass.properties.findAll { !excludedProps.contains(it.name) && historyProps.contains(it.name)}

0 commit comments

Comments
 (0)