only show access restrictions the user max see
This commit is contained in:
parent
40b19acfb6
commit
153c20410c
1 changed files with 7 additions and 1 deletions
|
@ -29,7 +29,13 @@ class AccessRestriction(TitledMixin, models.Model):
|
|||
|
||||
@classmethod
|
||||
def qs_for_request(cls, request):
|
||||
return cls.objects.all()
|
||||
return cls.objects.filter(cls.q_for_request(request))
|
||||
|
||||
@classmethod
|
||||
def q_for_request(cls, request):
|
||||
if request.user.is_authenticated and request.user.is_superuser:
|
||||
return Q()
|
||||
return Q(pk__in=AccessPermission.get_for_request(request))
|
||||
|
||||
|
||||
def default_valid_until():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue