Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Linnea Samila
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 860254e3
authored
Feb 21, 2016
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix rest place removing
1 parent
42255cc4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
code/moya-beans/ejbModule/fi/codecrew/moya/beans/EventMapBean.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/EventMapBean.java
View file @
860254e
...
...
@@ -53,9 +53,10 @@ public class EventMapBean implements EventMapBeanLocal {
@EJB
private
PlaceFacade
placefacade
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
EventMapBean
.
class
);
@EJB
private
PermissionBeanLocal
permbean
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
EventMapBean
.
class
);
@Override
@RolesAllowed
(
MapPermission
.
S_MANAGE_MAPS
)
...
...
@@ -110,6 +111,7 @@ public class EventMapBean implements EventMapBeanLocal {
if
(!
currentEvent
.
equals
(
place
.
getMap
().
getEvent
()))
{
throw
new
EJBAccessException
(
"Deleting placce for wrong event!"
);
}
placefacade
.
remove
(
place
);
}
@Override
...
...
@@ -119,7 +121,8 @@ public class EventMapBean implements EventMapBeanLocal {
Place
place
=
placefacade
.
find
(
id
);
LanEvent
currentEvent
=
eventbean
.
getCurrentEvent
();
if
(!
currentEvent
.
equals
(
place
.
getMap
().
getEvent
()))
{
throw
new
EJBAccessException
(
"Fetcing place for wrong event!"
);
logger
.
warn
(
"Tried to fetch place from wrong event!: user {}, place: {}, event {}"
,
permbean
.
getCurrentUser
(),
place
,
currentEvent
);
place
=
null
;
}
return
place
;
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment