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

Drop checks for course group owner-/membership in predicates

parent b0c3eda1
No related branches found
No related tags found
2 merge requests!352Draft: Resolve "Add dialog with each lesson's students",!350Resolve "Add simple course book list"
Pipeline #175583 failed
...@@ -354,8 +354,6 @@ def is_lesson_event_member(user: User, obj: LessonEvent): ...@@ -354,8 +354,6 @@ def is_lesson_event_member(user: User, obj: LessonEvent):
or a members of the course, if the lesson event has one. or a members of the course, if the lesson event has one.
""" """
if obj: if obj:
if obj.course and is_course_member(user, obj.course):
return True
for g in obj.groups.all(): for g in obj.groups.all():
if user.person in g.members.all(): if user.person in g.members.all():
return True return True
...@@ -372,8 +370,6 @@ def is_lesson_event_group_owner(user: User, obj: LessonEvent): ...@@ -372,8 +370,6 @@ def is_lesson_event_group_owner(user: User, obj: LessonEvent):
or a owner of any group linked to the course, if the lesson event has one. or a owner of any group linked to the course, if the lesson event has one.
""" """
if obj: if obj:
if obj.course and is_course_group_owner(user, obj.course):
return True
for g in obj.groups.all(): for g in obj.groups.all():
if user.person in g.owners.all(): if user.person in g.owners.all():
return True return True
...@@ -396,8 +392,6 @@ def can_view_documentation(user: User, obj: Documentation): ...@@ -396,8 +392,6 @@ def can_view_documentation(user: User, obj: Documentation):
if obj.course: if obj.course:
return ( return (
is_course_teacher(user, obj.course) is_course_teacher(user, obj.course)
| is_course_member(user, obj.course)
| is_course_group_owner(user, obj.course)
) )
return False return False
...@@ -411,5 +405,5 @@ def can_edit_documentation(user: User, obj: Documentation): ...@@ -411,5 +405,5 @@ def can_edit_documentation(user: User, obj: Documentation):
user, obj.lesson_event user, obj.lesson_event
) )
if obj.course: if obj.course:
return is_course_teacher(user, obj.course) | is_course_group_owner(user, obj.course) return is_course_teacher(user, obj.course)
return False return False
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