mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-18 10:29:23 +02:00
base logic
This commit is contained in:
parent
2012ac0108
commit
5a8c271647
13 changed files with 288 additions and 209 deletions
|
@ -749,6 +749,38 @@ class Finished(DomainRequestWizard):
|
|||
|
||||
class DomainRequestStatus(DomainRequestPermissionView):
|
||||
template_name = "domain_request_status.html"
|
||||
def has_permission(self):
|
||||
"""
|
||||
Override of the base has_permission class to account for portfolio permissions
|
||||
"""
|
||||
has_base_perms = super().has_permission()
|
||||
if not has_base_perms:
|
||||
return False
|
||||
|
||||
if self.request.user.is_org_user(self.request):
|
||||
portfolio = self.request.session.get("portfolio")
|
||||
if not self.request.user.has_edit_request_portfolio_permission(portfolio):
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
class DomainRequestStatusViewOnly(DomainRequestPermissionView):
|
||||
template_name = "domain_request_status_viewonly.html"
|
||||
def has_permission(self):
|
||||
"""
|
||||
Override of the base has_permission class to account for portfolio permissions
|
||||
"""
|
||||
has_base_perms = super().has_permission()
|
||||
if not has_base_perms:
|
||||
return False
|
||||
|
||||
if self.request.user.is_org_user(self.request):
|
||||
portfolio = self.request.session.get("portfolio")
|
||||
if not self.request.user.has_view_all_requests_portfolio_permission(portfolio):
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
class DomainRequestWithdrawConfirmation(DomainRequestPermissionWithdrawView):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue