|
@@ -35,10 +35,12 @@ from tracim.views.core_api.schemas import WorkspaceMemberSchema
|
35
|
35
|
from tracim.models.contents import ContentTypeLegacy as ContentType
|
36
|
36
|
from tracim.models.revision_protection import new_revision
|
37
|
37
|
|
|
38
|
+WORKSPACES_ENDPOINTS_TAG = 'Workspaces'
|
|
39
|
+
|
38
|
40
|
|
39
|
41
|
class WorkspaceController(Controller):
|
40
|
42
|
|
41
|
|
- @hapic.with_api_doc()
|
|
43
|
+ @hapic.with_api_doc(tags=[WORKSPACES_ENDPOINTS_TAG])
|
42
|
44
|
@hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
|
43
|
45
|
@hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
|
44
|
46
|
@hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
|
|
@@ -58,7 +60,7 @@ class WorkspaceController(Controller):
|
58
|
60
|
)
|
59
|
61
|
return wapi.get_workspace_with_context(request.current_workspace)
|
60
|
62
|
|
61
|
|
- @hapic.with_api_doc()
|
|
63
|
+ @hapic.with_api_doc(tags=[WORKSPACES_ENDPOINTS_TAG])
|
62
|
64
|
@hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
|
63
|
65
|
@hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
|
64
|
66
|
@hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
|
|
@@ -87,7 +89,7 @@ class WorkspaceController(Controller):
|
87
|
89
|
for user_role in roles
|
88
|
90
|
]
|
89
|
91
|
|
90
|
|
- @hapic.with_api_doc()
|
|
92
|
+ @hapic.with_api_doc(tags=[WORKSPACES_ENDPOINTS_TAG])
|
91
|
93
|
@hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
|
92
|
94
|
@hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
|
93
|
95
|
@hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
|
|
@@ -123,7 +125,7 @@ class WorkspaceController(Controller):
|
123
|
125
|
]
|
124
|
126
|
return contents
|
125
|
127
|
|
126
|
|
- @hapic.with_api_doc()
|
|
128
|
+ @hapic.with_api_doc(tags=[WORKSPACES_ENDPOINTS_TAG])
|
127
|
129
|
@hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
|
128
|
130
|
@hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
|
129
|
131
|
@hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
|
|
@@ -156,7 +158,7 @@ class WorkspaceController(Controller):
|
156
|
158
|
content = api.get_content_in_context(content)
|
157
|
159
|
return content
|
158
|
160
|
|
159
|
|
- @hapic.with_api_doc()
|
|
161
|
+ @hapic.with_api_doc(tags=[WORKSPACES_ENDPOINTS_TAG])
|
160
|
162
|
@hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
|
161
|
163
|
@hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
|
162
|
164
|
@hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
|
|
@@ -215,7 +217,7 @@ class WorkspaceController(Controller):
|
215
|
217
|
)
|
216
|
218
|
return api.get_content_in_context(updated_content)
|
217
|
219
|
|
218
|
|
- @hapic.with_api_doc()
|
|
220
|
+ @hapic.with_api_doc(tags=[WORKSPACES_ENDPOINTS_TAG])
|
219
|
221
|
@hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
|
220
|
222
|
@hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
|
221
|
223
|
@hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
|
|
@@ -250,7 +252,7 @@ class WorkspaceController(Controller):
|
250
|
252
|
api.delete(content)
|
251
|
253
|
return
|
252
|
254
|
|
253
|
|
- @hapic.with_api_doc()
|
|
255
|
+ @hapic.with_api_doc(tags=[WORKSPACES_ENDPOINTS_TAG])
|
254
|
256
|
@hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
|
255
|
257
|
@hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
|
256
|
258
|
@hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
|
|
@@ -286,7 +288,7 @@ class WorkspaceController(Controller):
|
286
|
288
|
api.undelete(content)
|
287
|
289
|
return
|
288
|
290
|
|
289
|
|
- @hapic.with_api_doc()
|
|
291
|
+ @hapic.with_api_doc(tags=[WORKSPACES_ENDPOINTS_TAG])
|
290
|
292
|
@hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
|
291
|
293
|
@hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
|
292
|
294
|
@hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
|
|
@@ -318,7 +320,7 @@ class WorkspaceController(Controller):
|
318
|
320
|
api.archive(content)
|
319
|
321
|
return
|
320
|
322
|
|
321
|
|
- @hapic.with_api_doc()
|
|
323
|
+ @hapic.with_api_doc(tags=[WORKSPACES_ENDPOINTS_TAG])
|
322
|
324
|
@hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
|
323
|
325
|
@hapic.handle_exception(InsufficientUserProfile, HTTPStatus.FORBIDDEN)
|
324
|
326
|
@hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
|