Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Alsijil
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Alsijil
Commits
9d252bb2
Commit
9d252bb2
authored
3 months ago
by
Hangzhi Yu
Browse files
Options
Downloads
Patches
Plain Diff
Fix documentation perm check for amended lessons
parent
bd736269
No related branches found
Branches containing commit
No related tags found
1 merge request
!454
Resolve "Room substitutions are not shown correctly"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/alsijil/util/predicates.py
+8
-0
8 additions, 0 deletions
aleksis/apps/alsijil/util/predicates.py
with
8 additions
and
0 deletions
aleksis/apps/alsijil/util/predicates.py
+
8
−
0
View file @
9d252bb2
...
...
@@ -193,6 +193,7 @@ def is_lesson_event_group_owner(user: User, obj: LessonEvent):
Checks whether the person linked to the user is a owner of any group
(or their respective parent groups) linked to the lesson event,
or a owner of any group linked to the course, if the lesson event has one.
Also checks for groups linked to the lesson being amended, if one exists.
"""
if
obj
:
for
g
in
obj
.
groups
.
all
():
...
...
@@ -201,6 +202,13 @@ def is_lesson_event_group_owner(user: User, obj: LessonEvent):
for
pg
in
g
.
parent_groups
.
all
():
if
user
.
person
in
pg
.
owners
.
all
():
return
True
if
obj
.
amends
:
for
g
in
obj
.
amends
.
groups
.
all
():
if
user
.
person
in
g
.
owners
.
all
():
return
True
for
pg
in
g
.
parent_groups
.
all
():
if
user
.
person
in
pg
.
owners
.
all
():
return
True
return
False
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment