Skip to content

Commit

Permalink
Merge pull request #3719 from webkom/prevent-superadmins-from-searchi…
Browse files Browse the repository at this point in the history
…ng-meetings

Prevent admins from searching meetings
  • Loading branch information
norbye authored Jan 25, 2025
2 parents 8c1ee36 + 1f453a8 commit c2b431c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lego/apps/meetings/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,15 @@ def has_perm(
if not user.is_authenticated:
return False

# Check object permissions before keywork perms
# Check object permissions before keyword perms
if obj is not None:
# Disable permission checking if the user is not a creator or invited to the meeting
# Supplying self.filter_queryset() functionality for individual objects as well
if not (
obj.created_by == user or obj.invited_users.filter(id=user.id).exists()
):
return False

if self.has_object_permissions(user, perm, obj):
return True

Expand Down

0 comments on commit c2b431c

Please sign in to comment.