Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Devrim Gunyel
core
Commits
d9cc78db
Commit
d9cc78db
authored
Apr 04, 2019
by
Piotr Gawron
Browse files
problem with removing project when privileges were limited
parent
0eb2d6dd
Changes
3
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
d9cc78db
...
...
@@ -7,6 +7,9 @@ minerva (12.2.2) stable; urgency=medium
disease
id
from
project
upload
was
used
instead
(#
779
)
*
Bug
fix
:
user
login
with
special
characters
(
like
'@'
)
could
cause
problems
in
admin
panel
(#
780
)
*
Bug
fix
:
removing
project
without
full
control
in
the
system
(
but
with
enough
privileges
to
remove
project
)
caused
"Not enough privileges"
error
(#
778
)
minerva
(
12.2.1
)
stable
;
urgency
=
medium
*
Bug
fix
:
export
of
reaction
colorsi
in
SBML
is
properly
encoded
(
COPASI
can
...
...
rest-api/src/test/java/lcsb/mapviewer/api/projects/ProjectRestImplTest.java
View file @
d9cc78db
...
...
@@ -33,6 +33,8 @@ import lcsb.mapviewer.converter.zip.ZipEntryFile;
import
lcsb.mapviewer.model.Project
;
import
lcsb.mapviewer.model.map.MiriamType
;
import
lcsb.mapviewer.model.map.model.Model
;
import
lcsb.mapviewer.model.user.PrivilegeType
;
import
lcsb.mapviewer.model.user.User
;
import
lcsb.mapviewer.persist.dao.ProjectDao
;
import
lcsb.mapviewer.services.interfaces.IModelService
;
import
lcsb.mapviewer.services.interfaces.IProjectService
;
...
...
@@ -81,6 +83,24 @@ public class ProjectRestImplTest extends RestTestFunctions {
}
}
@Test
public
void
testRemoveProject
()
throws
Exception
{
try
{
String
projectId
=
"test"
;
Project
project
=
new
Project
();
project
.
setProjectId
(
projectId
);
projectDao
.
add
(
project
);
User
user
=
userService
.
getUserByToken
(
token
);
userService
.
setUserPrivilege
(
user
,
PrivilegeType
.
VIEW_PROJECT
,
1
,
project
.
getId
(),
adminToken
);
userService
.
setUserPrivilege
(
user
,
PrivilegeType
.
PROJECT_MANAGEMENT
,
1
);
// userService.setUserPrivilege(user, PrivilegeType.VIEW_PROJECT, 1);
_projectRestImpl
.
removeProject
(
token
,
projectId
,
null
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
e
;
}
}
@Test
(
expected
=
ObjectNotFoundException
.
class
)
public
void
testGetInvalidMetaData
()
throws
Exception
{
ProjectRestImpl
projectRest
=
createMockProjectRest
(
null
);
...
...
service/src/main/java/lcsb/mapviewer/services/impl/ProjectService.java
View file @
d9cc78db
...
...
@@ -303,7 +303,6 @@ public class ProjectService implements IProjectService {
homeDir
=
null
;
}
}
removePrivilegesForProject
(
p
);
updateProjectStatus
(
p
,
ProjectStatus
.
REMOVING
,
0
,
new
CreateProjectParams
());
Thread
computations
=
new
Thread
(
new
Runnable
()
{
...
...
@@ -355,6 +354,7 @@ public class ProjectService implements IProjectService {
}
}
}
removePrivilegesForProject
(
project
);
projectDao
.
delete
(
project
);
if
(
async
)
{
projectDao
.
commit
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment