Skip to content
Snippets Groups Projects
Commit ff61b989 authored by Hangzhi Yu's avatar Hangzhi Yu
Browse files

Fix permission checking

parent 9f17d628
No related branches found
No related tags found
1 merge request!369Resolve "Permissions for timetables are not checked properly"
Pipeline #193440 passed
......@@ -1596,12 +1596,31 @@ class LessonEvent(CalendarEvent):
if type_ and obj_id:
if request and not (
check_global_permission(request.user, "chronos.view_all_group_timetables")
or check_global_permission(request.user, "chronos.view_all_person_timetables")
or check_global_permission(
request.user, "chronos.chronos.view_all_room_timetables"
(
type_ == "GROUP"
and check_global_permission(
request.user, "chronos.view_all_group_timetables"
)
)
or (
type_ == "TEACHER"
or type_ == "PARTICIPANT"
and check_global_permission(
request.user, "chronos.view_all_person_timetables"
)
)
or (
type_ == "ROOM"
and check_global_permission(
request.user, "chronos.chronos.view_all_room_timetables"
)
)
or (
type_ == "COURSE"
and check_global_permission(
request.user, "chronos.view_all_course_timetables"
)
)
or check_global_permission(request.user, "chronos.view_all_course_timetables")
):
# inline import needed to avoid circular import
from aleksis.apps.chronos.util.chronos_helpers import get_el_by_pk
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment