Commit 980ef3d9 by Tuukka Kivilahti

fixes #21 , Admin voi varata nyt lukitun paikan

1 parent 49e5e369
...@@ -182,7 +182,8 @@ public class PlaceBean implements PlaceBeanLocal { ...@@ -182,7 +182,8 @@ public class PlaceBean implements PlaceBeanLocal {
} }
/** /**
* Reserve the place for user. This reservation will timeout after a while buy() method should be called after this when buying place; * Reserve the place for user. This reservation will timeout after a while
* buy() method should be called after this when buying place;
* *
* @param place * @param place
* place to be reserved * place to be reserved
...@@ -196,7 +197,13 @@ public class PlaceBean implements PlaceBeanLocal { ...@@ -196,7 +197,13 @@ public class PlaceBean implements PlaceBeanLocal {
place = placeFacade.find(place.getId()); place = placeFacade.find(place.getId());
user = eventUserFacade.find(user.getId()); user = eventUserFacade.find(user.getId());
boolean ret = false; boolean ret = false;
if (place.isBuyable() && !place.isTaken()) { if (!place.isTaken()) {
if (place.isBuyable() || permbean.hasPermission(MapPermission.MANAGE_OTHERS)) {
if(!place.isBuyable()) {
place.setBuyable(true);
}
place.setCurrentUser(user); place.setCurrentUser(user);
place.setReleaseTime(Calendar.getInstance()); place.setReleaseTime(Calendar.getInstance());
place.getReleaseTime().add(Calendar.MINUTE, RESERVE_MINUTES); place.getReleaseTime().add(Calendar.MINUTE, RESERVE_MINUTES);
...@@ -215,6 +222,7 @@ public class PlaceBean implements PlaceBeanLocal { ...@@ -215,6 +222,7 @@ public class PlaceBean implements PlaceBeanLocal {
} }
ret = true; ret = true;
} }
}
return ret; return ret;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!