_aux_functions_templates
_check_template_duplication(*, user_id, name, version, db)
async
¶
Ensure that no WorkflowTemplate with the same
(user_id, name, version) already exists.
| PARAMETER | DESCRIPTION |
|---|---|
user_id
|
TYPE:
|
name
|
TYPE:
|
version
|
TYPE:
|
db
|
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
HTTPException(status_code=HTTP_422_UNPROCESSABLE_CONTENT)
|
If a duplicate template is found. |
Source code in fractal_server/app/routes/api/v2/_aux_functions_templates.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
_get_template_full_access(*, user_id, template_id, db)
async
¶
Retrieve a WorkflowTemplate and ensure the user is its owner.
| PARAMETER | DESCRIPTION |
|---|---|
user_id
|
TYPE:
|
template_id
|
TYPE:
|
db
|
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
WorkflowTemplate
|
The |
| RAISES | DESCRIPTION |
|---|---|
HTTPException(status_code=404_NOT_FOUND)
|
If no template exists with the given ID. |
HTTPException(status_code=403_FORBIDDEN)
|
If the user is not the owner. |
Source code in fractal_server/app/routes/api/v2/_aux_functions_templates.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
_get_template_or_404(*, template_id, db)
async
¶
Retrieve a WorkflowTemplate by ID.
| PARAMETER | DESCRIPTION |
|---|---|
template_id
|
TYPE:
|
db
|
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
WorkflowTemplate
|
The |
| RAISES | DESCRIPTION |
|---|---|
HTTPException(status_code=404_NOT_FOUND)
|
If no template exists with the given ID. |
Source code in fractal_server/app/routes/api/v2/_aux_functions_templates.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
_get_template_read_access(*, user_id, template_id, db)
async
¶
Retrieve a WorkflowTemplate and ensure the user has read access.
Access is granted if the user is the owner of the template or belongs to the template's user group.
| PARAMETER | DESCRIPTION |
|---|---|
user_id
|
TYPE:
|
template_id
|
TYPE:
|
db
|
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
WorkflowTemplate
|
The |
| RAISES | DESCRIPTION |
|---|---|
HTTPException(status_code=404_NOT_FOUND)
|
If no template exists with the given ID. |
HTTPException(status_code=403_FORBIDDEN)
|
If the user has not read access. |
Source code in fractal_server/app/routes/api/v2/_aux_functions_templates.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | |