-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroles.py
75 lines (71 loc) · 3.55 KB
/
roles.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core business involves the administration of students, teachers,
# courses, programs and so on.
#
# Copyright (C) 2015-2024 Université catholique de Louvain (http://www.uclouvain.be)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# A copy of this license - GNU General Public License - is available
# at the root of the source code of this program. If not,
# see http://www.gnu.org/licenses/.
#
# ##############################################################################
from rules import always_allow
from osis_role import role
from parcours_doctoral.auth.predicates.parcours_doctoral import (
complementary_training_enabled,
is_jury_in_progress,
is_part_of_education_group,
submitted_confirmation_paper,
)
from parcours_doctoral.auth.roles.adre import AdreSecretary
from parcours_doctoral.auth.roles.ca_member import CommitteeMember
from parcours_doctoral.auth.roles.cdd_configurator import CddConfigurator
from parcours_doctoral.auth.roles.jury_secretary import JurySecretary
from parcours_doctoral.auth.roles.promoter import Promoter
from parcours_doctoral.auth.roles.student import Student
role.role_manager.register(CddConfigurator)
role.role_manager.register(JurySecretary)
role.role_manager.register(AdreSecretary)
role.role_manager.register(Student)
role.role_manager.register(Promoter)
role.role_manager.register(CommitteeMember)
PROGRAM_MANAGER_RULES = {
# Doctorats
'parcours_doctoral.view_parcours_doctoral': always_allow,
# --- Projet de recherche
'parcours_doctoral.view_supervision': is_part_of_education_group,
# --- Confirmation
'parcours_doctoral.view_confirmation': is_part_of_education_group,
'parcours_doctoral.change_confirmation': is_part_of_education_group,
'parcours_doctoral.change_confirmation_extension': is_part_of_education_group,
'parcours_doctoral.make_confirmation_decision': is_part_of_education_group & submitted_confirmation_paper,
'parcours_doctoral.send_message': is_part_of_education_group,
# -- Formation doctorale
'parcours_doctoral.view_training': is_part_of_education_group,
'parcours_doctoral.view_doctoral_training': is_part_of_education_group,
'parcours_doctoral.view_complementary_training': is_part_of_education_group & complementary_training_enabled,
'parcours_doctoral.view_course_enrollment': is_part_of_education_group,
'parcours_doctoral.change_activity': is_part_of_education_group,
'parcours_doctoral.delete_activity': is_part_of_education_group,
'parcours_doctoral.refuse_activity': is_part_of_education_group,
'parcours_doctoral.restore_activity': is_part_of_education_group,
# -- Jury
'parcours_doctoral.view_jury': is_part_of_education_group & is_jury_in_progress,
'parcours_doctoral.change_jury': is_part_of_education_group & is_jury_in_progress,
# -- Défense
# -- Soutenance
}