mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 04:19:25 +00:00
Selected club members can now see subscriptions
This commit is contained in:
@ -414,6 +414,17 @@ class User(AbstractBaseUser):
|
||||
.has_rights_in_club(self)
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def can_read_subscription(self):
|
||||
from club.models import Club
|
||||
|
||||
for club in Club.objects.filter(
|
||||
id__in=settings.SITH_CAN_READ_SUBSCRIPTIONS
|
||||
).all():
|
||||
if club.has_rights_in_club(self):
|
||||
return True
|
||||
return False
|
||||
|
||||
@cached_property
|
||||
def can_create_subscription(self):
|
||||
from club.models import Club
|
||||
@ -691,6 +702,10 @@ class AnonymousUser(AuthAnonymousUser):
|
||||
def can_create_subscription(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def can_read_subscription(self):
|
||||
return False
|
||||
|
||||
@property
|
||||
def was_subscribed(self):
|
||||
return False
|
||||
|
Reference in New Issue
Block a user