Commit 2cf56407 by Tuomas Riihimäki

Participate role checking.

1 parent 1eeae2e4
...@@ -118,7 +118,7 @@ public class MenuBean implements MenuBeanLocal { ...@@ -118,7 +118,7 @@ public class MenuBean implements MenuBeanLocal {
userprofile.addPage(menuitemfacade.findOrCreate("/user/edit"), UserPermission.VIEW_SELF); userprofile.addPage(menuitemfacade.findOrCreate("/user/edit"), UserPermission.VIEW_SELF);
userprofile.addPage(menuitemfacade.findOrCreate("/user/changePassword"), UserPermission.VIEW_SELF); userprofile.addPage(menuitemfacade.findOrCreate("/user/changePassword"), UserPermission.VIEW_SELF);
userprofile.addPage(menuitemfacade.findOrCreate("/user/gameids"), TournamentPermission.VIEW); userprofile.addPage(menuitemfacade.findOrCreate("/user/gameids"), TournamentPermission.PARTICIPATE);
userprofile.addPage(menuitemfacade.findOrCreate("/auth/logout"), UserPermission.LOGOUT); userprofile.addPage(menuitemfacade.findOrCreate("/auth/logout"), UserPermission.LOGOUT);
MenuNavigation tournaments = usermenu.addPage(null, null); MenuNavigation tournaments = usermenu.addPage(null, null);
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<project>lib-AuthModule-depends</project> <project>lib-AuthModule-depends</project>
<project>MoyaAuthModule</project> <project>MoyaAuthModule</project>
<project>MoyaCardPrinter</project> <project>MoyaCardPrinter</project>
<project>MoyaEventMgmtWeb</project>
</projects> </projects>
<buildSpec> <buildSpec>
<buildCommand> <buildCommand>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/application_7.xsd" version="7"> <application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/application_7.xsd"
version="7">
<display-name>moya-ear</display-name> <display-name>moya-ear</display-name>
<module> <module>
<ejb>moya-beans-0.2.0.jar</ejb> <ejb>moya-beans-0.2.0.jar</ejb>
...@@ -10,5 +13,7 @@ ...@@ -10,5 +13,7 @@
<context-root>/MoyaWeb</context-root> <context-root>/MoyaWeb</context-root>
</web> </web>
</module> </module>
<!-- <module> <web> <web-uri>MoyaEventMgmtWeb.war</web-uri> <context-root>EventMgmt</context-root>
</web> </module> -->
<library-directory>lib</library-directory> <library-directory>lib</library-directory>
</application> </application>
\ No newline at end of file
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
<param-name>javax.faces.PROJECT_STAGE</param-name> <param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value> <param-value>Development</param-value>
</context-param> </context-param>
<filter> <filter>
<display-name>PrimefacesFileupload</display-name> <display-name>PrimefacesFileupload</display-name>
<filter-name>PrimefacesFileupload</filter-name> <filter-name>PrimefacesFileupload</filter-name>
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
<h:body> <h:body>
<ui:composition template="#{sessionHandler.template}"> <ui:composition template="#{sessionHandler.template}">
<f:metadata> <f:metadata>
<f:event type="preRenderView" listener="#{tournamentDeleteView.initView()}" />
</f:metadata> </f:metadata>
<ui:define name="content"> <ui:define name="content">
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<h:body> <h:body>
<ui:composition template="#{sessionHandler.template}"> <ui:composition template="#{sessionHandler.template}">
<f:metadata> <f:metadata>
<f:event type="preRenderView" listener="#{tournamentEditView.initView()}" />
</f:metadata> </f:metadata>
<ui:define name="content"> <ui:define name="content">
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<h:body> <h:body>
<ui:composition template="#{sessionHandler.template}"> <ui:composition template="#{sessionHandler.template}">
<f:metadata> <f:metadata>
<f:event type="preRenderView" listener="#{tournamentAdminView.initView()}" />
</f:metadata> </f:metadata>
<ui:define name="content"> <ui:define name="content">
......
<!DOCTYPE html <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:users="http://java.sun.com/jsf/composite/cditools/user" xmlns:tools="http://java.sun.com/jsf/composite/cditools" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:users="http://java.sun.com/jsf/composite/cditools/user"
xmlns:tools="http://java.sun.com/jsf/composite/cditools" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core">
<h:body> <h:body>
<ui:composition template="#{sessionHandler.template}"> <ui:composition template="#{sessionHandler.template}">
<f:metadata> <f:metadata>
<f:event type="preRenderView" listener="#{tournamentListView.initView()}" />
</f:metadata> </f:metadata>
<ui:define name="content"> <ui:define name="content">
...@@ -67,13 +70,14 @@ ...@@ -67,13 +70,14 @@
<f:param name="tournament_id" value="#{tournament.id}" /> <f:param name="tournament_id" value="#{tournament.id}" />
</h:link> </h:link>
</p:column> </p:column>
<p:column> <p:column rendered="#{tournamentListView.canParticipate()}">
<f:facet name="header"> <f:facet name="header">
<h:outputText value="#{i18n['tournament.control']}" /> <h:outputText value="#{i18n['tournament.control']}" />
</f:facet> </f:facet>
<h:panelGroup> <h:panelGroup>
<p:commandButton value="#{i18n['tournament.participate']}" action="#{tournamentParticipateView.participate(tournament.id)}" rendered="#{tournament.participants.size() lt tournament.maxParticipants}" ajax="false"/> <p:commandButton value="#{i18n['tournament.participate']}" action="#{tournamentParticipateView.participate(tournament.id)}"
<h:outputText value="#{i18n['tournament.full']}" rendered="#{tournament.participants.size() ge tournament.maxParticipants}"/> rendered="#{tournament.participants.size() lt tournament.maxParticipants}" ajax="false" />
<h:outputText value="#{i18n['tournament.full']}" rendered="#{tournament.participants.size() ge tournament.maxParticipants}" />
</h:panelGroup> </h:panelGroup>
</p:column> </p:column>
<p:rowExpansion> <p:rowExpansion>
...@@ -82,10 +86,8 @@ ...@@ -82,10 +86,8 @@
<h:panelGroup> <h:panelGroup>
<ul> <ul>
<ui:repeat var="participant" value="#{tournament.participants}"> <ui:repeat var="participant" value="#{tournament.participants}">
<li> <li><h:outputText value="#{participant.teamName}" rendered="#{not empty participant.teamName}" /> <h:outputText value="#{participant.participator.user.nick}"
<h:outputText value="#{participant.teamName}" rendered="#{not empty participant.teamName}" /> rendered="#{empty participant.teamName}" /></li>
<h:outputText value="#{participant.participator.user.nick}" rendered="#{empty participant.teamName}" />
</li>
</ui:repeat> </ui:repeat>
</ul> </ul>
</h:panelGroup> </h:panelGroup>
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<h:body> <h:body>
<ui:composition template="#{sessionHandler.template}"> <ui:composition template="#{sessionHandler.template}">
<f:metadata> <f:metadata>
<f:event type="preRenderView" listener="#{tournamentParticipateView.initView()}" />
</f:metadata> </f:metadata>
<ui:define name="content"> <ui:define name="content">
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<h:body> <h:body>
<ui:composition template="#{sessionHandler.template}"> <ui:composition template="#{sessionHandler.template}">
<f:metadata> <f:metadata>
<f:event type="preRenderView" listener="#{tournamentParticipateView.initView()}" />
</f:metadata> </f:metadata>
<ui:define name="content"> <ui:define name="content">
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
<dependency> <dependency>
<groupId>org.primefaces</groupId> <groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId> <artifactId>primefaces</artifactId>
<version>4.0-SNAPSHOT</version> <version>4.0.RC1</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -7,12 +7,24 @@ import javax.enterprise.context.RequestScoped; ...@@ -7,12 +7,24 @@ import javax.enterprise.context.RequestScoped;
import javax.inject.Named; import javax.inject.Named;
import fi.codecrew.moya.beans.TournamentBeanLocal; import fi.codecrew.moya.beans.TournamentBeanLocal;
import fi.codecrew.moya.enums.apps.TournamentPermission;
import fi.codecrew.moya.model.Tournament; import fi.codecrew.moya.model.Tournament;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
@RequestScoped @RequestScoped
@Named @Named
public class TournamentAdminView { public class TournamentAdminView extends GenericCDIView {
@EJB private TournamentBeanLocal tournamentBean; /**
*
*/
private static final long serialVersionUID = -9079431236226432769L;
@EJB
private TournamentBeanLocal tournamentBean;
public void initView()
{
super.requirePermissions(TournamentPermission.MANAGE_ALL);
}
public List<Tournament> getActiveTournaments() { public List<Tournament> getActiveTournaments() {
List<Tournament> tl = tournamentBean.getActiveTournaments(); List<Tournament> tl = tournamentBean.getActiveTournaments();
......
package fi.codecrew.moya.web.cdiview.tournaments; package fi.codecrew.moya.web.cdiview.tournaments;
import java.io.Serializable;
import java.util.List; import java.util.List;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.inject.Named;
import org.primefaces.event.FlowEvent;
import fi.codecrew.moya.beans.EventBeanLocal; import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.beans.TournamentBeanLocal; import fi.codecrew.moya.beans.TournamentBeanLocal;
import fi.codecrew.moya.enums.TournamentStatus; import fi.codecrew.moya.enums.TournamentStatus;
import fi.codecrew.moya.enums.TournamentType; import fi.codecrew.moya.enums.TournamentType;
import fi.codecrew.moya.model.Role; import fi.codecrew.moya.enums.apps.TournamentPermission;
import fi.codecrew.moya.model.Tournament; import fi.codecrew.moya.model.Tournament;
import fi.codecrew.moya.model.TournamentGame; import fi.codecrew.moya.model.TournamentGame;
import fi.codecrew.moya.model.TournamentRule; import fi.codecrew.moya.model.TournamentRule;
import fi.codecrew.moya.utilities.jsf.MessageHelper; import fi.codecrew.moya.utilities.jsf.MessageHelper;
import fi.codecrew.moya.web.cdiview.GenericCDIView; import fi.codecrew.moya.web.cdiview.GenericCDIView;
import javax.ejb.EJB;
import javax.ejb.Remove;
import javax.enterprise.context.ConversationScoped;
import javax.faces.event.ActionEvent;
import javax.inject.Named;
import org.primefaces.event.FlowEvent;
@Named @Named
@ConversationScoped @ConversationScoped
public class TournamentCreateView extends GenericCDIView { public class TournamentCreateView extends GenericCDIView {
...@@ -43,11 +40,13 @@ public class TournamentCreateView extends GenericCDIView { ...@@ -43,11 +40,13 @@ public class TournamentCreateView extends GenericCDIView {
private Integer backupPlayers; private Integer backupPlayers;
@EJB TournamentBeanLocal tournamentBean; @EJB
@EJB EventBeanLocal eventBean; TournamentBeanLocal tournamentBean;
@EJB
EventBeanLocal eventBean;
public void initView() { public void initView() {
if(tournament == null) { if (super.requirePermissions(TournamentPermission.MANAGE_ALL) && tournament == null) {
this.beginConversation(); this.beginConversation();
tournament = new Tournament(); tournament = new Tournament();
tournament.setPlayersPerMatch(0); tournament.setPlayersPerMatch(0);
...@@ -57,7 +56,6 @@ public class TournamentCreateView extends GenericCDIView { ...@@ -57,7 +56,6 @@ public class TournamentCreateView extends GenericCDIView {
} }
} }
public String save() { public String save() {
tournament.setPlayersPerTeam(tournament.getPlayersPerMatch() + backupPlayers); tournament.setPlayersPerTeam(tournament.getPlayersPerMatch() + backupPlayers);
tournament.setLanEvent(eventBean.getCurrentEvent()); tournament.setLanEvent(eventBean.getCurrentEvent());
...@@ -69,7 +67,7 @@ public class TournamentCreateView extends GenericCDIView { ...@@ -69,7 +67,7 @@ public class TournamentCreateView extends GenericCDIView {
tournamentBean.createTournament(tournament); tournamentBean.createTournament(tournament);
this.endConversation(); this.endConversation();
return "success"; return "success";
} catch(Exception e) { } catch (Exception e) {
MessageHelper.err(e.getMessage()); MessageHelper.err(e.getMessage());
return ""; return "";
} }
...@@ -93,9 +91,9 @@ public class TournamentCreateView extends GenericCDIView { ...@@ -93,9 +91,9 @@ public class TournamentCreateView extends GenericCDIView {
} }
public String onFlowProcess(FlowEvent event) { public String onFlowProcess(FlowEvent event) {
switch(event.getOldStep()) { switch (event.getOldStep()) {
case "selectGame": case "selectGame":
if(tournamentGameName.length() > 0) { if (tournamentGameName.length() > 0) {
// oh lurd, we want to create a new gamy now // oh lurd, we want to create a new gamy now
TournamentGame tg = new TournamentGame(); TournamentGame tg = new TournamentGame();
tg.setName(tournamentGameName); tg.setName(tournamentGameName);
...@@ -109,7 +107,7 @@ public class TournamentCreateView extends GenericCDIView { ...@@ -109,7 +107,7 @@ public class TournamentCreateView extends GenericCDIView {
System.out.println(tournamentRules); System.out.println(tournamentRules);
break; break;
case "selectRuleset": case "selectRuleset":
if(rulesetName != null && rulesetName.length() > 0) { if (rulesetName != null && rulesetName.length() > 0) {
TournamentRule tr = new TournamentRule(); TournamentRule tr = new TournamentRule();
tr.setName(rulesetName); tr.setName(rulesetName);
tr.setDescription(rulesetDescription); tr.setDescription(rulesetDescription);
......
...@@ -2,11 +2,10 @@ package fi.codecrew.moya.web.cdiview.tournaments; ...@@ -2,11 +2,10 @@ package fi.codecrew.moya.web.cdiview.tournaments;
import javax.ejb.EJB; import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped; import javax.enterprise.context.ConversationScoped;
import javax.enterprise.context.RequestScoped;
import javax.faces.bean.ManagedProperty;
import javax.inject.Named; import javax.inject.Named;
import fi.codecrew.moya.beans.TournamentBeanLocal; import fi.codecrew.moya.beans.TournamentBeanLocal;
import fi.codecrew.moya.enums.apps.TournamentPermission;
import fi.codecrew.moya.utilities.I18n; import fi.codecrew.moya.utilities.I18n;
import fi.codecrew.moya.utilities.jsf.MessageHelper; import fi.codecrew.moya.utilities.jsf.MessageHelper;
import fi.codecrew.moya.web.cdiview.GenericCDIView; import fi.codecrew.moya.web.cdiview.GenericCDIView;
...@@ -17,7 +16,13 @@ public class TournamentDeleteView extends GenericCDIView { ...@@ -17,7 +16,13 @@ public class TournamentDeleteView extends GenericCDIView {
private static final long serialVersionUID = 7283815262506163537L; private static final long serialVersionUID = 7283815262506163537L;
private Integer id = null; private Integer id = null;
@EJB private TournamentBeanLocal tournamentBean; @EJB
private TournamentBeanLocal tournamentBean;
public void initView()
{
super.requirePermissions(TournamentPermission.MANAGE_ALL);
}
public String showConfirm(Integer id) { public String showConfirm(Integer id) {
this.beginConversation(); this.beginConversation();
...@@ -26,11 +31,11 @@ public class TournamentDeleteView extends GenericCDIView { ...@@ -26,11 +31,11 @@ public class TournamentDeleteView extends GenericCDIView {
} }
public String delete() { public String delete() {
if(this.id != null) { if (this.id != null) {
try { try {
tournamentBean.deleteTournament(tournamentBean.getTournamentById(this.id)); tournamentBean.deleteTournament(tournamentBean.getTournamentById(this.id));
MessageHelper.info(I18n.get("tournament.admin.tournament_deleted_successfully")); MessageHelper.info(I18n.get("tournament.admin.tournament_deleted_successfully"));
} catch(Exception e) { } catch (Exception e) {
MessageHelper.err(I18n.get("tournament.admin.tournament_delete_failed")); MessageHelper.err(I18n.get("tournament.admin.tournament_delete_failed"));
} }
} else { } else {
......
...@@ -2,10 +2,10 @@ package fi.codecrew.moya.web.cdiview.tournaments; ...@@ -2,10 +2,10 @@ package fi.codecrew.moya.web.cdiview.tournaments;
import javax.ejb.EJB; import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped; import javax.enterprise.context.ConversationScoped;
import javax.enterprise.context.RequestScoped;
import javax.inject.Named; import javax.inject.Named;
import fi.codecrew.moya.beans.TournamentBeanLocal; import fi.codecrew.moya.beans.TournamentBeanLocal;
import fi.codecrew.moya.enums.apps.TournamentPermission;
import fi.codecrew.moya.model.Tournament; import fi.codecrew.moya.model.Tournament;
import fi.codecrew.moya.utilities.I18n; import fi.codecrew.moya.utilities.I18n;
import fi.codecrew.moya.utilities.jsf.MessageHelper; import fi.codecrew.moya.utilities.jsf.MessageHelper;
...@@ -15,9 +15,19 @@ import fi.codecrew.moya.web.cdiview.GenericCDIView; ...@@ -15,9 +15,19 @@ import fi.codecrew.moya.web.cdiview.GenericCDIView;
@ConversationScoped @ConversationScoped
public class TournamentEditView extends GenericCDIView { public class TournamentEditView extends GenericCDIView {
@EJB private TournamentBeanLocal tournamentBean; /**
*
*/
private static final long serialVersionUID = -2655058086651272660L;
@EJB
private TournamentBeanLocal tournamentBean;
private Tournament tournament = null; private Tournament tournament = null;
public void initView()
{
super.requirePermissions(TournamentPermission.MANAGE_ALL);
}
public String showEdit(Integer tournamentId) { public String showEdit(Integer tournamentId) {
this.beginConversation(); this.beginConversation();
this.setTournament(tournamentBean.getTournamentById(tournamentId)); this.setTournament(tournamentBean.getTournamentById(tournamentId));
...@@ -25,11 +35,11 @@ public class TournamentEditView extends GenericCDIView { ...@@ -25,11 +35,11 @@ public class TournamentEditView extends GenericCDIView {
} }
public String commit() { public String commit() {
if(this.tournament != null) { if (this.tournament != null) {
try { try {
this.tournamentBean.editTournament(tournament); this.tournamentBean.editTournament(tournament);
MessageHelper.info(I18n.get("tournament.admin.tournament_edited_successfully")); MessageHelper.info(I18n.get("tournament.admin.tournament_edited_successfully"));
} catch(Exception e) { } catch (Exception e) {
MessageHelper.err(I18n.get("tournament.admin.tournament_edit_failed")); MessageHelper.err(I18n.get("tournament.admin.tournament_edit_failed"));
} }
} else { } else {
......
...@@ -16,6 +16,10 @@ import fi.codecrew.moya.web.cdiview.GenericCDIView; ...@@ -16,6 +16,10 @@ import fi.codecrew.moya.web.cdiview.GenericCDIView;
@RequestScoped @RequestScoped
public class TournamentListView extends GenericCDIView { public class TournamentListView extends GenericCDIView {
/**
*
*/
private static final long serialVersionUID = 5401481953726472887L;
@EJB @EJB
private TournamentBeanLocal tournamentBean; private TournamentBeanLocal tournamentBean;
...@@ -23,6 +27,10 @@ public class TournamentListView extends GenericCDIView { ...@@ -23,6 +27,10 @@ public class TournamentListView extends GenericCDIView {
super.requirePermissions(TournamentPermission.VIEW); super.requirePermissions(TournamentPermission.VIEW);
} }
public boolean canParticipate() {
return super.hasPermission(TournamentPermission.PARTICIPATE);
}
public List<Tournament> getSetupPhaseTournaments() { public List<Tournament> getSetupPhaseTournaments() {
return tournamentBean.getTournamentsInStatus(TournamentStatus.SETUP, true); return tournamentBean.getTournamentsInStatus(TournamentStatus.SETUP, true);
} }
......
...@@ -29,6 +29,10 @@ public class TournamentParticipateView extends GenericCDIView { ...@@ -29,6 +29,10 @@ public class TournamentParticipateView extends GenericCDIView {
@EJB @EJB
private PermissionBeanLocal permissionBean; private PermissionBeanLocal permissionBean;
public void initView() {
super.requirePermissions(TournamentPermission.PARTICIPATE);
}
private String selectedPlayerLogin; private String selectedPlayerLogin;
private String selectedBackupPlayerLogin; private String selectedBackupPlayerLogin;
...@@ -66,6 +70,11 @@ public class TournamentParticipateView extends GenericCDIView { ...@@ -66,6 +70,11 @@ public class TournamentParticipateView extends GenericCDIView {
} }
public String participate(Integer tournamentId) { public String participate(Integer tournamentId) {
if (!super.hasPermission(TournamentPermission.PARTICIPATE)) {
super.addFaceMessage("tournament.notRightsToParticipate");
return null;
}
tournament = tournamentBean.getTournamentById(tournamentId); tournament = tournamentBean.getTournamentById(tournamentId);
if (tournamentBean.hasParticipations(permissionBean.getCurrentUser(), tournament)) { if (tournamentBean.hasParticipations(permissionBean.getCurrentUser(), tournament)) {
MessageHelper.err("tournament.already_participated_into_tournament"); MessageHelper.err("tournament.already_participated_into_tournament");
......
package fi.codecrew.moya.web.cdiview.tournaments; package fi.codecrew.moya.web.cdiview.tournaments;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.EJB; import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped; import javax.enterprise.context.RequestScoped;
import javax.faces.bean.ManagedProperty;
import javax.inject.Named; import javax.inject.Named;
import fi.codecrew.moya.beans.TournamentBeanLocal; import fi.codecrew.moya.beans.TournamentBeanLocal;
import fi.codecrew.moya.enums.TournamentStatus; import fi.codecrew.moya.enums.apps.TournamentPermission;
import fi.codecrew.moya.model.Tournament; import fi.codecrew.moya.model.Tournament;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
@Named @Named
@RequestScoped @RequestScoped
public class TournamentRulesView { public class TournamentRulesView extends GenericCDIView {
@EJB private TournamentBeanLocal tournamentBean; /**
*
*/
private static final long serialVersionUID = 590702851593367871L;
@EJB
private TournamentBeanLocal tournamentBean;
private Tournament tournament; private Tournament tournament;
private Integer tournamentId; private Integer tournamentId;
public void init() { public void init() {
if (super.requirePermissions(TournamentPermission.VIEW))
{
tournament = tournamentBean.getTournamentById(tournamentId); tournament = tournamentBean.getTournamentById(tournamentId);
} }
}
public Integer getTournamentId() { public Integer getTournamentId() {
return tournamentId; return tournamentId;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!