Create access profiles from HTML5 workspace
This commit is contained in:
@@ -57,6 +57,8 @@ from api_server.html5_forms import (
|
||||
)
|
||||
from api_server.html5_access_controller import (
|
||||
html5_access_page as _html5_access_page,
|
||||
html5_access_profile_apply as _html5_access_profile_apply,
|
||||
html5_access_profile_preview as _html5_access_profile_preview,
|
||||
html5_access_publish_dry_run as _html5_access_publish_dry_run,
|
||||
html5_access_publish_plan as _html5_access_publish_plan,
|
||||
)
|
||||
@@ -1564,6 +1566,35 @@ async def html5_project_access_profile_plan(project_id: str, profile_name: str)
|
||||
)
|
||||
|
||||
|
||||
@app.post("/html5/projects/{project_id}/access/profile-preview")
|
||||
async def html5_project_access_profile_preview(project_id: str, request: Request) -> Response:
|
||||
form = await _html5_form_data(request)
|
||||
return _html5_response(
|
||||
await _html5_access_profile_preview(
|
||||
project_id=project_id,
|
||||
form=form,
|
||||
preview_profile=preview_project_access_profile,
|
||||
draft_request=AccessProfileDraftRequest,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@app.post("/html5/projects/{project_id}/access/profiles")
|
||||
async def html5_project_access_profile_apply(project_id: str, request: Request) -> Response:
|
||||
form = await _html5_form_data(request)
|
||||
return _html5_response(
|
||||
await _html5_access_profile_apply(
|
||||
project_id=project_id,
|
||||
form=form,
|
||||
apply_profile=apply_project_access_profile,
|
||||
apply_request=AccessProfileApplyRequest,
|
||||
normalized_project=_normalized_project_or_404,
|
||||
access_profile_by_name=_access_profile_by_name,
|
||||
access_publish_plan=_build_access_profile_publish_plan,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@app.post("/html5/projects/{project_id}/access/profiles/{profile_name}/publish-dry-run")
|
||||
async def html5_project_access_profile_publish_dry_run(project_id: str, profile_name: str) -> Response:
|
||||
return _html5_response(
|
||||
|
||||
Reference in New Issue
Block a user