This commit is contained in:
@@ -75,16 +75,33 @@ public class EvaluationController extends SimpleFormController {
|
|||||||
protected Object formBackingObject(HttpServletRequest request)
|
protected Object formBackingObject(HttpServletRequest request)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
|
|
||||||
|
|
||||||
Conference conf = SessionService.getInstance().getCurrentConference();
|
Conference conf = SessionService.getInstance().getCurrentConference();
|
||||||
|
String memberId = SessionService.getInstance().getCurrentUserLogin();
|
||||||
|
|
||||||
|
|
||||||
List<Criterion> criterionList = evaluationManager.getCriterions(conf.getId());
|
List<Criterion> criterionList = evaluationManager.getCriterions(conf.getId());
|
||||||
String articleId = request.getParameter("id");
|
String articleId = request.getParameter("id");
|
||||||
String action = request.getParameter("action");
|
String action = request.getParameter("action");
|
||||||
|
boolean haveArticle = false;
|
||||||
|
List<Article> listarticles = articleManager.getArticlesOfMember(conf.getId(), memberId);
|
||||||
|
for (Article article : listarticles) {
|
||||||
|
if(article.getId() == Integer.parseInt(articleId)){
|
||||||
|
haveArticle = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!haveArticle){
|
||||||
|
throw new ModelAndViewDefiningException(new ModelAndView("denied"));
|
||||||
|
}
|
||||||
// TODO : verifier que le gars a le droit d'evaluer cette article
|
// TODO : verifier que le gars a le droit d'evaluer cette article
|
||||||
// TODO : s'il existe deja une al, mais que l'action est pas modify, virer le gars
|
// TODO : s'il existe deja une al, mais que l'action est pas modify, virer le gars
|
||||||
|
|
||||||
if (action == null || action.equals("")) {
|
if (action == null || action.equals("")) {
|
||||||
|
Report report = evaluationManager.getReportforArticleAndReferee(Integer.parseInt(articleId), memberId);
|
||||||
|
if(report != null){
|
||||||
|
throw new ModelAndViewDefiningException(new ModelAndView("denied"));
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
Integer id = new Integer(articleId);
|
Integer id = new Integer(articleId);
|
||||||
Article a = articleManager.getArticle(id);
|
Article a = articleManager.getArticle(id);
|
||||||
|
|||||||
Reference in New Issue
Block a user