diff --git a/atst/domain/authz/decorator.py b/atst/domain/authz/decorator.py index 210e570d..cf79808b 100644 --- a/atst/domain/authz/decorator.py +++ b/atst/domain/authz/decorator.py @@ -8,12 +8,8 @@ from atst.domain.task_orders import TaskOrders from atst.domain.exceptions import UnauthorizedError -def evaluate_exceptions(user, permission, exceptions, **kwargs): - return ( - True - if True in [exc(user, permission, **kwargs) for exc in exceptions] - else False - ) +def evaluate_exceptions(user, exceptions, **kwargs): + return True if True in [exc(user, **kwargs) for exc in exceptions] else False def check_access(permission, message, exceptions, *args, **kwargs): @@ -28,7 +24,7 @@ def check_access(permission, message, exceptions, *args, **kwargs): access_args["portfolio"] = task_order.portfolio if exceptions and evaluate_exceptions( - g.current_user, permission, exceptions, **access_args, **kwargs + g.current_user, exceptions, **access_args, **kwargs ): return True diff --git a/atst/routes/portfolios/applications.py b/atst/routes/portfolios/applications.py index f0de8fec..d8ab31da 100644 --- a/atst/routes/portfolios/applications.py +++ b/atst/routes/portfolios/applications.py @@ -97,7 +97,7 @@ def update_application(portfolio_id, application_id): def wrap_environment_role_lookup( - user, _perm, portfolio_id=None, environment_id=None, **kwargs + user, portfolio_id=None, environment_id=None, **kwargs ): env_role = EnvironmentRoles.get(user.id, environment_id) if not env_role: diff --git a/atst/routes/portfolios/task_orders.py b/atst/routes/portfolios/task_orders.py index 67ef9519..e2165aa8 100644 --- a/atst/routes/portfolios/task_orders.py +++ b/atst/routes/portfolios/task_orders.py @@ -89,7 +89,7 @@ def view_task_order(portfolio_id, task_order_id): ) -def wrap_check_is_ko_or_cor(user, _perm, task_order_id=None, **_kwargs): +def wrap_check_is_ko_or_cor(user, task_order_id=None, **_kwargs): task_order = TaskOrders.get(task_order_id) Authorization.check_is_ko_or_cor(user, task_order) @@ -290,7 +290,7 @@ def so_review_form(task_order): return DD254Form(data=form_data) -def wrap_check_is_so(user, _perm, task_order_id=None, **_kwargs): +def wrap_check_is_so(user, task_order_id=None, **_kwargs): task_order = TaskOrders.get(task_order_id) Authorization.check_is_so(user, task_order) diff --git a/atst/routes/task_orders/signing.py b/atst/routes/task_orders/signing.py index 3b4f4bc5..e8eaf0a6 100644 --- a/atst/routes/task_orders/signing.py +++ b/atst/routes/task_orders/signing.py @@ -20,7 +20,7 @@ def find_unsigned_ko_to(task_order_id): return task_order -def wrap_check_is_ko(user, _perm, task_order_id=None, **_kwargs): +def wrap_check_is_ko(user, task_order_id=None, **_kwargs): task_order = TaskOrders.get(task_order_id) Authorization.check_is_ko(user, task_order)