From 1adb9d34601f8affbb46ce4375a1a2489175f86e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Sat, 14 Dec 2024 15:05:01 +0000 Subject: [PATCH] fix control_panel permission --- src/c3nav/control/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/c3nav/control/models.py b/src/c3nav/control/models.py index f1be9933..e879418b 100644 --- a/src/c3nav/control/models.py +++ b/src/c3nav/control/models.py @@ -56,14 +56,14 @@ class UserPermissions(models.Model): @property def control_panel(self): - return ( + return bool( self.view_users or self.grant_permissions or self.manage_announcements or self.grant_all_access or self.grant_unlimited_access or self.grant_space_access - or AccessPermission.get_for_user(user=self.user, can_grant=True) + or AccessPermission.get_for_user(user=self.user if self.user_id else None, can_grant=True) ) @staticmethod