pseudo code for 796 and 806

This commit is contained in:
rachidatecs 2023-08-01 19:06:40 -04:00
parent 3d94b71533
commit f500a4ff50
No known key found for this signature in database
GPG key ID: 3CEBBFA7325E5525
2 changed files with 11 additions and 0 deletions

View file

@ -33,6 +33,8 @@
</thead> </thead>
<tbody> <tbody>
{% for domain in domains %} {% for domain in domains %}
{% comment %} ticket 796
{% if domain.application_status == "approved" or (domain.application does not exist) %} {% endcomment %}
<tr> <tr>
<th th scope="row" role="rowheader" data-label="Domain name"> <th th scope="row" role="rowheader" data-label="Domain name">
{{ domain.name }} {{ domain.name }}

View file

@ -24,6 +24,11 @@ class DomainPermission(PermissionsLoginMixin):
The user is in self.request.user and the domain needs to be looked The user is in self.request.user and the domain needs to be looked
up from the domain's primary key in self.kwargs["pk"] up from the domain's primary key in self.kwargs["pk"]
""" """
# ticket 806
# if self.request.user is staff or admin and domain.application__status = 'approved' or 'rejected' or 'action needed'
# return True
if not self.request.user.is_authenticated: if not self.request.user.is_authenticated:
return False return False
@ -32,6 +37,10 @@ class DomainPermission(PermissionsLoginMixin):
user=self.request.user, domain__id=self.kwargs["pk"] user=self.request.user, domain__id=self.kwargs["pk"]
).exists(): ).exists():
return False return False
# ticket 796
# if domain.application__status != 'approved'
# return false
# if we need to check more about the nature of role, do it here. # if we need to check more about the nature of role, do it here.
return True return True