fsr-de / myHPI

Django/Wagtail page serving myhpi.de
https://myhpi.de
12 stars 11 forks source link

Use wagtail privacy system #222

Open jeriox opened 2 years ago

jeriox commented 2 years ago

For some now unknown reason, we decided to build our own stuff for privacy (restricting pages to specific groups). As this adds complexity, we should check whether the wagtail system also fulfills our need

jeriox commented 2 years ago

@frcroth just checked in on the wagtail system, which is fine for the groups themselves. The problem why we didn't use it lies in our IPRangeUserMiddleware. We are injecting a group into the AnonymousUser, but as django does not support such a thing, we only set an additional attribute on the user which leads to wagtail denying the permission because the user does not belong to the necessary group.