Subversion Repositories bacoAlunos

Rev

Rev 1606 | Rev 1656 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1606 Rev 1628
Line 1... Line 1...
1
package pt.estgp.estgweb.filters.filters;
1
package pt.estgp.estgweb.filters.filters;
2
 
2
 
3
import pt.estgp.estgweb.Globals;
-
 
4
import pt.estgp.estgweb.domain.*;
3
import pt.estgp.estgweb.domain.*;
5
import pt.estgp.estgweb.domain.dao.DaoFactory;
4
import pt.estgp.estgweb.domain.dao.DaoFactory;
6
 
5
 
7
import java.util.List;
6
import java.util.List;
8
 
7
 
Line 37... Line 36...
37
            else if(super.canAccessResource(userSession,identifier))
36
            else if(super.canAccessResource(userSession,identifier))
38
                return true;
37
                return true;
39
            //PRESIDENTES DE ESCOLA SO VEEM SE ESTIVER ATIVO
38
            //PRESIDENTES DE ESCOLA SO VEEM SE ESTIVER ATIVO
40
            else if(q.isActive())
39
            else if(q.isActive())
41
            {
40
            {
-
 
41
                /*
-
 
42
                DIRECAO DA ESCOLA SAI
42
                //CHECK IF THERE IS ANY UNIT IN SCHOLL AND IF THIS USER IS FROM THE BOARD OF THAT SCHOOL
43
                //CHECK IF THERE IS ANY UNIT IN SCHOLL AND IF THIS USER IS FROM THE BOARD OF THAT SCHOOL
43
                if(userSession.getUser().hasRole(Globals.ROLE_BOARD_SCHOOL_ESAE) ||
44
                if(userSession.getUser().hasRole(Globals.ROLE_BOARD_SCHOOL_ESAE) ||
44
                        userSession.getUser().hasRole(Globals.ROLE_BOARD_SCHOOL_ESAE) ||
45
                        userSession.getUser().hasRole(Globals.ROLE_BOARD_SCHOOL_ESAE) ||
45
                        userSession.getUser().hasRole(Globals.ROLE_BOARD_SCHOOL_ESAE) ||
46
                        userSession.getUser().hasRole(Globals.ROLE_BOARD_SCHOOL_ESAE) ||
46
                        userSession.getUser().hasRole(Globals.ROLE_BOARD_SCHOOL_ESAE))
47
                        userSession.getUser().hasRole(Globals.ROLE_BOARD_SCHOOL_ESAE))
Line 56... Line 57...
56
                        {
57
                        {
57
                            return true;
58
                            return true;
58
                        }
59
                        }
59
                    }
60
                    }
60
                }
61
                }
-
 
62
                */
-
 
63
 
-
 
64
 
-
 
65
                //DEPARTAMENTO
-
 
66
                //Carrega as unidades do Docente e confirma se alguma das unidades
-
 
67
                //pertence a um departamento onde o user atual esteja ligado
-
 
68
                List<CourseUnit> courseUnitList = DaoFactory
-
 
69
                        .getCourseUnitDaoImpl()
-
 
70
                        .loadTeachedImportYearSemestreUnits(t.getId(), questionarioReportFileGroupDocentesAno.getImportYear());
-
 
71
 
-
 
72
                for(CourseUnit cu : courseUnitList)
-
 
73
                {
-
 
74
                    if(cu.getCourse().getDepartment() != null)
-
 
75
                    {
-
 
76
                        if(cu.getCourse().getDepartment().getBoardRole() != null)
-
 
77
                            if(userSession.getUser().hasRole(cu.getCourse().getDepartment().getBoardRole()))
-
 
78
                                return true;
-
 
79
 
-
 
80
                        if(cu.getCourse().getDepartment().getDirectorRole() != null)
-
 
81
                            if(userSession.getUser().hasRole(cu.getCourse().getDepartment().getDirectorRole()))
-
 
82
                                return true;
-
 
83
                    }
-
 
84
 
-
 
85
                }
-
 
86
 
61
            }
87
            }
62
 
88
 
63
            return false;
89
            return false;
64
 
90
 
65
        }
91
        }