Skip to content

Commit

Permalink
fix permission check
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Dec 6, 2024
1 parent 7b1e090 commit 161ee72
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/api/views/school_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Teacher,
User,
)
from codeforlife.user.permissions import IsStudent, IsTeacher
from codeforlife.user.permissions import IsIndependent, IsStudent, IsTeacher

from .school import SchoolViewSet

Expand Down Expand Up @@ -69,7 +69,12 @@ def test_get_permissions__partial_update(self):
def test_get_permissions__retrieve(self):
"""Anyone in a school can retrieve a school."""
self.assert_get_permissions(
permissions=[OR(IsStudent(), IsTeacher(in_school=True))],
permissions=[
OR(
OR(IsStudent(), IsTeacher(in_school=True)),
IsIndependent(is_requesting_to_join_class=True),
)
],
action="retrieve",
)

Expand Down

0 comments on commit 161ee72

Please sign in to comment.