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 99309154
authored
Dec 10, 2014
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add checking for selecting places
1 parent
e0c3d5bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
code/moya-web/src/main/java/fi/codecrew/moya/rest/placemap/v1/PlacemapRestViewV1.java
code/moya-web/src/main/java/fi/codecrew/moya/rest/placemap/v1/PlacemapRestViewV1.java
View file @
9930915
...
...
@@ -22,6 +22,7 @@ import org.slf4j.LoggerFactory;
import
fi.codecrew.moya.beans.PermissionBeanLocal
;
import
fi.codecrew.moya.beans.PlaceBeanLocal
;
import
fi.codecrew.moya.beans.QueueBeanLocal
;
import
fi.codecrew.moya.model.EventMap
;
import
fi.codecrew.moya.model.EventUser
;
import
fi.codecrew.moya.model.Place
;
...
...
@@ -47,6 +48,9 @@ public class PlacemapRestViewV1 {
@Inject
private
UserView
userView
;
@EJB
private
QueueBeanLocal
quebean
;
// @GET
// @Path("/maps")
// public PlacemapMapRootPojo getMaps()
...
...
@@ -116,6 +120,13 @@ public class PlacemapRestViewV1 {
}
Place
p
=
placebean
.
find
(
placeId
);
EventMap
map
=
p
.
getMap
();
if
(!
quebean
.
isReserving
(
map
,
user
))
{
logger
.
warn
(
"User is not in reservation order "
);
return
Response
.
status
(
Response
.
Status
.
FORBIDDEN
).
build
();
}
boolean
success
=
false
;
if
(
p
.
isReservedFor
(
user
))
{
success
=
placebean
.
releasePlace
(
p
);
...
...
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