diff --git a/core/management/commands/populate.py b/core/management/commands/populate.py
index 26bc6074..53638699 100644
--- a/core/management/commands/populate.py
+++ b/core/management/commands/populate.py
@@ -125,6 +125,11 @@ class Command(BaseCommand):
unix_name=settings.SITH_MAIN_CLUB["unix_name"],
address=settings.SITH_MAIN_CLUB["address"],
)
+ main_club.board_group.permissions.add(
+ *Permission.objects.filter(
+ codename__in=["view_subscription", "add_subscription"]
+ )
+ )
bar_club = Club.objects.create(
id=2,
name=settings.SITH_BAR_MANAGER["name"],
diff --git a/core/models.py b/core/models.py
index b1caa912..4748f311 100644
--- a/core/models.py
+++ b/core/models.py
@@ -417,29 +417,6 @@ class User(AbstractUser):
def is_board_member(self) -> bool:
return self.groups.filter(club_board=settings.SITH_MAIN_CLUB_ID).exists()
- @cached_property
- def can_read_subscription_history(self) -> bool:
- if self.is_root or self.is_board_member:
- return True
-
- from club.models import Club
-
- for club in Club.objects.filter(
- id__in=settings.SITH_CAN_READ_SUBSCRIPTION_HISTORY
- ):
- if club in self.clubs_with_rights:
- return True
- return False
-
- @cached_property
- def can_create_subscription(self) -> bool:
- return self.is_root or (
- self.memberships.board()
- .ongoing()
- .filter(club_id__in=settings.SITH_CAN_CREATE_SUBSCRIPTIONS)
- .exists()
- )
-
@cached_property
def is_launderette_manager(self):
from club.models import Club
@@ -679,14 +656,6 @@ class AnonymousUser(AuthAnonymousUser):
def __init__(self):
super().__init__()
- @property
- def can_create_subscription(self):
- return False
-
- @property
- def can_read_subscription_history(self):
- return False
-
@property
def was_subscribed(self):
return False
diff --git a/core/templates/core/user_detail.jinja b/core/templates/core/user_detail.jinja
index cb93b1cd..22db9abe 100644
--- a/core/templates/core/user_detail.jinja
+++ b/core/templates/core/user_detail.jinja
@@ -166,7 +166,7 @@
{% endif %}
-{% if profile.was_subscribed and (user == profile or user.can_read_subscription_history)%}
+{% if profile.was_subscribed and (user == profile or user.has_perm("subscription.view_subscription")) %}