Merge pull request #676 from dod-ccpo/to-edit-sign-permissions

Break KO signing  into two steps
This commit is contained in:
George Drummond
2019-02-27 09:43:48 -05:00
committed by GitHub
9 changed files with 226 additions and 41 deletions

View File

@@ -36,6 +36,27 @@ class Authorization(object):
def is_ccpo(cls, user):
return user.atat_role.name == "ccpo"
@classmethod
def is_ko(cls, user, task_order):
return user == task_order.contracting_officer
@classmethod
def is_cor(cls, user, task_order):
return user == task_order.contracting_officer_representative
@classmethod
def is_so(cls, user, task_order):
return user == task_order.security_officer
@classmethod
def check_is_ko_or_cor(cls, user, task_order):
if Authorization.is_ko(user, task_order) or Authorization.is_cor(
user, task_order
):
return True
else:
raise UnauthorizedError(user, "not KO or COR")
@classmethod
def check_is_ko(cls, user, task_order):
if task_order.contracting_officer != user:

View File

@@ -120,6 +120,10 @@ class TaskOrders(object):
return True
@classmethod
def is_signed_by_ko(cls, task_order):
return task_order.signer_dod_id is not None
@classmethod
def mission_owner_sections(cls):
section_list = TaskOrders.SECTIONS