replace MetaGroups by proper group management

This commit is contained in:
imperosol
2024-11-30 20:30:17 +01:00
parent cce7ecbe73
commit 6400b2c2c2
16 changed files with 410 additions and 355 deletions

View File

@ -532,9 +532,12 @@ class Counter(models.Model):
return user.is_in_group(pk=settings.SITH_GROUP_COUNTER_ADMIN_ID)
def can_be_viewed_by(self, user: User) -> bool:
if self.type == "BAR":
return True
return user.is_board_member or user in self.sellers.all()
return (
self.type == "BAR"
or user.is_root
or user.is_in_group(pk=self.club.board_group_id)
or user in self.sellers.all()
)
def gen_token(self) -> None:
"""Generate a new token for this counter."""