hpi-swa-lab / BP2021RH1

Crowd-Sourced Picture Archive for Bad Harzburg / BP2021RH1
https://bilder.bad-harzburg-stiftung.de/
MIT License
4 stars 0 forks source link

Fix removal of user leaking permissions to public user #647

Closed MariusDoe closed 3 weeks ago

MariusDoe commented 3 weeks ago

Previously, the user was deleted before the user's permissions were looked up. The removal of the user cleared the user column of the user's permissions to NULL, so the lookup did not find any permissions and thus the public user (id NULL) received the deleted user's permissions. Now, the lookup (and deletion) of the permissions is done before the deletion of the user, which avoids this problem.

MariusDoe commented 3 weeks ago

Nen ON DELETE CASCADE oder so um beim löschen der User auch gleich die permissions mitzulöschen ohne es rückwärts manuell machen zu müssen gibt es nicht so einfach bei strapi, oder?

Hatte ich auch schon geguckt, leider nicht :/