learning-unlimited / ESP-Website

A website to help manage the logistics of large, short-term educational programs
82 stars 57 forks source link

Fix permissions in custom forms #3670

Closed willgearty closed 10 months ago

willgearty commented 11 months ago

This fixes the lists of permissions in the custom form builder. I also fixed the text next to the checkbox so when you click the text it activates/deactivates the checkbox.

Fixes https://github.com/learning-unlimited/ESP-Website/issues/3658.

willgearty commented 10 months ago

I think that's outside the scope of this PR, but I'll start looking into it...

willgearty commented 10 months ago

I think the permissions are only checked if you try to fill out the form outside of a program module (e.g., /customforms/view/[id]). I was able to trigger it and get the correct error message: image

Interestingly, admins don't appear to have all permissions according to the way this checks the permissions: https://github.com/learning-unlimited/ESP-Website/blob/53ddfe2c9b636d29e4ebb94633bc0fe5fb4928a2/esp/esp/customforms/views.py#L284-L312