Skip to content
Snippets Groups Projects
Verified Commit aeb6bf91 authored by Janis Streib's avatar Janis Streib :owl:
Browse files

UPD: only allow patch request on devel if user has wapi.devel_tester role

parent d67f6b7d
No related branches found
No related tags found
No related merge requests found
Pipeline #409251 passed
......@@ -146,6 +146,13 @@ async def handle_request(patch_request_form_request: PatchRequestFormRequest,
def validate_patch_request_actions(conn, user, actions: list[APIPatchRequestAction]) -> list[PatchRequestAction]:
internal_actions = []
host_is_prod = db.host_omdl.OP_ENV_IS_PROD
if not host_is_prod and not user.has_permission(conn, 'wapi.devel_versions_user'):
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail='This is the development site! '
'Please use patch request on the production site (https://netvs.scc.kit.edu)'
)
for action in actions:
internal_action = PatchRequestAction()
# TODO handle unpatch vs missing parameters
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment