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

Reformat

parent baece794
No related branches found
No related tags found
1 merge request!113Resolve "Review permissions"
...@@ -13,9 +13,9 @@ def has_timetable_perm(user: User, obj: Model) -> bool: ...@@ -13,9 +13,9 @@ def has_timetable_perm(user: User, obj: Model) -> bool:
"""Predicate which checks whether the user is allowed to access the requested timetable.""" """Predicate which checks whether the user is allowed to access the requested timetable."""
if type(obj) is Group: if type(obj) is Group:
return ( return (
user.person.member_of.filter(id=obj.id).exists() obj in user.person.member_of.all()
or user.person.primary_group == obj or user.person.primary_group == obj
or user.person.owner_of.filter(id=obj.id).exists() or obj in user.person.owner_of.all()
or has_global_perm("chronos.view_all_group_timetables")(user) or has_global_perm("chronos.view_all_group_timetables")(user)
or has_object_perm("core.view_group_timetable")(user, obj) or has_object_perm("core.view_group_timetable")(user, obj)
) )
......
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