Browse Source

rename exception

Guénaël Muller 6 years ago
parent
commit
d055b04c46

+ 1 - 1
tracim/exceptions.py View File

69
     pass
69
     pass
70
 
70
 
71
 
71
 
72
-class InsufficientUserWorkspaceRole(TracimException):
72
+class InsufficientUserRoleInWorkspace(TracimException):
73
     pass
73
     pass
74
 
74
 
75
 
75
 

+ 4 - 4
tracim/lib/utils/authorization.py View File

14
     JSONDecodeError = ValueError
14
     JSONDecodeError = ValueError
15
 
15
 
16
 from tracim.models.contents import ContentTypeLegacy as ContentType
16
 from tracim.models.contents import ContentTypeLegacy as ContentType
17
-from tracim.exceptions import InsufficientUserWorkspaceRole
17
+from tracim.exceptions import InsufficientUserRoleInWorkspace
18
 from tracim.exceptions import ContentTypeNotAllowed
18
 from tracim.exceptions import ContentTypeNotAllowed
19
 from tracim.exceptions import InsufficientUserProfile
19
 from tracim.exceptions import InsufficientUserProfile
20
 if TYPE_CHECKING:
20
 if TYPE_CHECKING:
105
             workspace = request.current_workspace
105
             workspace = request.current_workspace
106
             if workspace.get_user_role(user) >= minimal_required_role:
106
             if workspace.get_user_role(user) >= minimal_required_role:
107
                 return func(self, context, request)
107
                 return func(self, context, request)
108
-            raise InsufficientUserWorkspaceRole()
108
+            raise InsufficientUserRoleInWorkspace()
109
 
109
 
110
         return wrapper
110
         return wrapper
111
     return decorator
111
     return decorator
127
 
127
 
128
             if workspace.get_user_role(user) >= minimal_required_role:
128
             if workspace.get_user_role(user) >= minimal_required_role:
129
                 return func(self, context, request)
129
                 return func(self, context, request)
130
-            raise InsufficientUserWorkspaceRole()
130
+            raise InsufficientUserRoleInWorkspace()
131
 
131
 
132
         return wrapper
132
         return wrapper
133
     return decorator
133
     return decorator
180
             # INFO - G.M - 2018-06-178 - normal role test
180
             # INFO - G.M - 2018-06-178 - normal role test
181
             if workspace.get_user_role(user) >= minimal_required_role:
181
             if workspace.get_user_role(user) >= minimal_required_role:
182
                 return func(self, context, request)
182
                 return func(self, context, request)
183
-            raise InsufficientUserWorkspaceRole()
183
+            raise InsufficientUserRoleInWorkspace()
184
         return wrapper
184
         return wrapper
185
     return decorator
185
     return decorator

+ 4 - 4
tracim/views/contents_api/comment_controller.py View File

20
 from tracim.views.core_api.schemas import WorkspaceAndContentIdPathSchema
20
 from tracim.views.core_api.schemas import WorkspaceAndContentIdPathSchema
21
 from tracim.views.core_api.schemas import NoContentSchema
21
 from tracim.views.core_api.schemas import NoContentSchema
22
 from tracim.exceptions import WorkspaceNotFound
22
 from tracim.exceptions import WorkspaceNotFound
23
-from tracim.exceptions import InsufficientUserWorkspaceRole
23
+from tracim.exceptions import InsufficientUserRoleInWorkspace
24
 from tracim.exceptions import NotAuthenticated
24
 from tracim.exceptions import NotAuthenticated
25
 from tracim.exceptions import AuthenticationFailed
25
 from tracim.exceptions import AuthenticationFailed
26
 from tracim.models.contents import ContentTypeLegacy as ContentType
26
 from tracim.models.contents import ContentTypeLegacy as ContentType
34
 
34
 
35
     @hapic.with_api_doc(tags=[COMMENT_ENDPOINTS_TAG])
35
     @hapic.with_api_doc(tags=[COMMENT_ENDPOINTS_TAG])
36
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
36
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
37
-    @hapic.handle_exception(InsufficientUserWorkspaceRole, HTTPStatus.FORBIDDEN)
37
+    @hapic.handle_exception(InsufficientUserRoleInWorkspace, HTTPStatus.FORBIDDEN)
38
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
38
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
39
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
39
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
40
     @require_workspace_role(UserRoleInWorkspace.READER)
40
     @require_workspace_role(UserRoleInWorkspace.READER)
64
 
64
 
65
     @hapic.with_api_doc(tags=[COMMENT_ENDPOINTS_TAG])
65
     @hapic.with_api_doc(tags=[COMMENT_ENDPOINTS_TAG])
66
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
66
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
67
-    @hapic.handle_exception(InsufficientUserWorkspaceRole, HTTPStatus.FORBIDDEN)
67
+    @hapic.handle_exception(InsufficientUserRoleInWorkspace, HTTPStatus.FORBIDDEN)
68
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
68
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
69
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
69
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
70
     @require_workspace_role(UserRoleInWorkspace.CONTRIBUTOR)
70
     @require_workspace_role(UserRoleInWorkspace.CONTRIBUTOR)
96
 
96
 
97
     @hapic.with_api_doc(tags=[COMMENT_ENDPOINTS_TAG])
97
     @hapic.with_api_doc(tags=[COMMENT_ENDPOINTS_TAG])
98
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
98
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
99
-    @hapic.handle_exception(InsufficientUserWorkspaceRole, HTTPStatus.FORBIDDEN)
99
+    @hapic.handle_exception(InsufficientUserRoleInWorkspace, HTTPStatus.FORBIDDEN)
100
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
100
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
101
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
101
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
102
     @require_comment_ownership_or_role(
102
     @require_comment_ownership_or_role(

+ 5 - 5
tracim/views/contents_api/html_document_controller.py View File

25
 from tracim.lib.utils.authorization import require_workspace_role
25
 from tracim.lib.utils.authorization import require_workspace_role
26
 from tracim.exceptions import WorkspaceNotFound
26
 from tracim.exceptions import WorkspaceNotFound
27
 from tracim.exceptions import ContentTypeNotAllowed
27
 from tracim.exceptions import ContentTypeNotAllowed
28
-from tracim.exceptions import InsufficientUserWorkspaceRole
28
+from tracim.exceptions import InsufficientUserRoleInWorkspace
29
 from tracim.exceptions import NotAuthenticated
29
 from tracim.exceptions import NotAuthenticated
30
 from tracim.exceptions import AuthenticationFailed
30
 from tracim.exceptions import AuthenticationFailed
31
 from tracim.models.context_models import ContentInContext
31
 from tracim.models.context_models import ContentInContext
41
 
41
 
42
     @hapic.with_api_doc(tags=[HTML_DOCUMENT_ENDPOINTS_TAG])
42
     @hapic.with_api_doc(tags=[HTML_DOCUMENT_ENDPOINTS_TAG])
43
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
43
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
44
-    @hapic.handle_exception(InsufficientUserWorkspaceRole, HTTPStatus.FORBIDDEN)
44
+    @hapic.handle_exception(InsufficientUserRoleInWorkspace, HTTPStatus.FORBIDDEN)
45
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
45
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
46
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
46
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
47
     @hapic.handle_exception(ContentTypeNotAllowed, HTTPStatus.BAD_REQUEST)
47
     @hapic.handle_exception(ContentTypeNotAllowed, HTTPStatus.BAD_REQUEST)
67
 
67
 
68
     @hapic.with_api_doc(tags=[HTML_DOCUMENT_ENDPOINTS_TAG])
68
     @hapic.with_api_doc(tags=[HTML_DOCUMENT_ENDPOINTS_TAG])
69
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
69
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
70
-    @hapic.handle_exception(InsufficientUserWorkspaceRole, HTTPStatus.FORBIDDEN)
70
+    @hapic.handle_exception(InsufficientUserRoleInWorkspace, HTTPStatus.FORBIDDEN)
71
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
71
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
72
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
72
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
73
     @require_workspace_role(UserRoleInWorkspace.CONTRIBUTOR)
73
     @require_workspace_role(UserRoleInWorkspace.CONTRIBUTOR)
105
 
105
 
106
     @hapic.with_api_doc(tags=[HTML_DOCUMENT_ENDPOINTS_TAG])
106
     @hapic.with_api_doc(tags=[HTML_DOCUMENT_ENDPOINTS_TAG])
107
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
107
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
108
-    @hapic.handle_exception(InsufficientUserWorkspaceRole, HTTPStatus.FORBIDDEN)
108
+    @hapic.handle_exception(InsufficientUserRoleInWorkspace, HTTPStatus.FORBIDDEN)
109
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
109
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
110
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
110
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
111
     @require_workspace_role(UserRoleInWorkspace.READER)
111
     @require_workspace_role(UserRoleInWorkspace.READER)
139
 
139
 
140
     @hapic.with_api_doc(tags=[HTML_DOCUMENT_ENDPOINTS_TAG])
140
     @hapic.with_api_doc(tags=[HTML_DOCUMENT_ENDPOINTS_TAG])
141
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
141
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
142
-    @hapic.handle_exception(InsufficientUserWorkspaceRole, HTTPStatus.FORBIDDEN)
142
+    @hapic.handle_exception(InsufficientUserRoleInWorkspace, HTTPStatus.FORBIDDEN)
143
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
143
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
144
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
144
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
145
     @require_workspace_role(UserRoleInWorkspace.CONTRIBUTOR)
145
     @require_workspace_role(UserRoleInWorkspace.CONTRIBUTOR)

+ 5 - 5
tracim/views/contents_api/threads_controller.py View File

23
 from tracim.lib.utils.authorization import require_content_types
23
 from tracim.lib.utils.authorization import require_content_types
24
 from tracim.lib.utils.authorization import require_workspace_role
24
 from tracim.lib.utils.authorization import require_workspace_role
25
 from tracim.exceptions import WorkspaceNotFound, ContentTypeNotAllowed
25
 from tracim.exceptions import WorkspaceNotFound, ContentTypeNotAllowed
26
-from tracim.exceptions import InsufficientUserWorkspaceRole
26
+from tracim.exceptions import InsufficientUserRoleInWorkspace
27
 from tracim.exceptions import NotAuthenticated
27
 from tracim.exceptions import NotAuthenticated
28
 from tracim.exceptions import AuthenticationFailed
28
 from tracim.exceptions import AuthenticationFailed
29
 from tracim.models.context_models import ContentInContext
29
 from tracim.models.context_models import ContentInContext
39
 
39
 
40
     @hapic.with_api_doc(tags=[THREAD_ENDPOINTS_TAG])
40
     @hapic.with_api_doc(tags=[THREAD_ENDPOINTS_TAG])
41
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
41
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
42
-    @hapic.handle_exception(InsufficientUserWorkspaceRole, HTTPStatus.FORBIDDEN)
42
+    @hapic.handle_exception(InsufficientUserRoleInWorkspace, HTTPStatus.FORBIDDEN)
43
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
43
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
44
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
44
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
45
     @hapic.handle_exception(ContentTypeNotAllowed, HTTPStatus.BAD_REQUEST)
45
     @hapic.handle_exception(ContentTypeNotAllowed, HTTPStatus.BAD_REQUEST)
65
 
65
 
66
     @hapic.with_api_doc(tags=[THREAD_ENDPOINTS_TAG])
66
     @hapic.with_api_doc(tags=[THREAD_ENDPOINTS_TAG])
67
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
67
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
68
-    @hapic.handle_exception(InsufficientUserWorkspaceRole, HTTPStatus.FORBIDDEN)
68
+    @hapic.handle_exception(InsufficientUserRoleInWorkspace, HTTPStatus.FORBIDDEN)
69
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
69
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
70
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
70
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
71
     @require_workspace_role(UserRoleInWorkspace.CONTRIBUTOR)
71
     @require_workspace_role(UserRoleInWorkspace.CONTRIBUTOR)
103
 
103
 
104
     @hapic.with_api_doc(tags=[THREAD_ENDPOINTS_TAG])
104
     @hapic.with_api_doc(tags=[THREAD_ENDPOINTS_TAG])
105
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
105
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
106
-    @hapic.handle_exception(InsufficientUserWorkspaceRole, HTTPStatus.FORBIDDEN)
106
+    @hapic.handle_exception(InsufficientUserRoleInWorkspace, HTTPStatus.FORBIDDEN)
107
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
107
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
108
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
108
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
109
     @require_workspace_role(UserRoleInWorkspace.READER)
109
     @require_workspace_role(UserRoleInWorkspace.READER)
137
 
137
 
138
     @hapic.with_api_doc(tags=[THREAD_ENDPOINTS_TAG])
138
     @hapic.with_api_doc(tags=[THREAD_ENDPOINTS_TAG])
139
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
139
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
140
-    @hapic.handle_exception(InsufficientUserWorkspaceRole, HTTPStatus.FORBIDDEN)
140
+    @hapic.handle_exception(InsufficientUserRoleInWorkspace, HTTPStatus.FORBIDDEN)
141
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
141
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
142
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
142
     @hapic.handle_exception(AuthenticationFailed, HTTPStatus.FORBIDDEN)
143
     @require_workspace_role(UserRoleInWorkspace.CONTRIBUTOR)
143
     @require_workspace_role(UserRoleInWorkspace.CONTRIBUTOR)

+ 10 - 10
tracim/views/core_api/workspace_controller.py View File

17
 from tracim.models.data import ActionDescription
17
 from tracim.models.data import ActionDescription
18
 from tracim.models.context_models import UserRoleWorkspaceInContext
18
 from tracim.models.context_models import UserRoleWorkspaceInContext
19
 from tracim.models.context_models import ContentInContext
19
 from tracim.models.context_models import ContentInContext
20
-from tracim.exceptions import NotAuthenticated, InsufficientUserWorkspaceRole
20
+from tracim.exceptions import NotAuthenticated, InsufficientUserRoleInWorkspace
21
 from tracim.exceptions import WorkspaceNotFoundInTracimRequest
21
 from tracim.exceptions import WorkspaceNotFoundInTracimRequest
22
 from tracim.exceptions import WorkspacesDoNotMatch
22
 from tracim.exceptions import WorkspacesDoNotMatch
23
 from tracim.exceptions import WorkspaceNotFound
23
 from tracim.exceptions import WorkspaceNotFound
41
 
41
 
42
     @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
42
     @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
43
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
43
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
44
-    @hapic.handle_exception(InsufficientUserWorkspaceRole, HTTPStatus.FORBIDDEN)
44
+    @hapic.handle_exception(InsufficientUserRoleInWorkspace, HTTPStatus.FORBIDDEN)
45
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
45
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
46
     @require_workspace_role(UserRoleInWorkspace.READER)
46
     @require_workspace_role(UserRoleInWorkspace.READER)
47
     @hapic.input_path(WorkspaceIdPathSchema())
47
     @hapic.input_path(WorkspaceIdPathSchema())
61
 
61
 
62
     @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
62
     @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
63
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
63
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
64
-    @hapic.handle_exception(InsufficientUserWorkspaceRole, HTTPStatus.FORBIDDEN)
64
+    @hapic.handle_exception(InsufficientUserRoleInWorkspace, HTTPStatus.FORBIDDEN)
65
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
65
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
66
     @require_workspace_role(UserRoleInWorkspace.READER)
66
     @require_workspace_role(UserRoleInWorkspace.READER)
67
     @hapic.input_path(WorkspaceIdPathSchema())
67
     @hapic.input_path(WorkspaceIdPathSchema())
90
 
90
 
91
     @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
91
     @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
92
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
92
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
93
-    @hapic.handle_exception(InsufficientUserWorkspaceRole, HTTPStatus.FORBIDDEN)
93
+    @hapic.handle_exception(InsufficientUserRoleInWorkspace, HTTPStatus.FORBIDDEN)
94
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
94
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
95
     @require_workspace_role(UserRoleInWorkspace.READER)
95
     @require_workspace_role(UserRoleInWorkspace.READER)
96
     @hapic.input_path(WorkspaceIdPathSchema())
96
     @hapic.input_path(WorkspaceIdPathSchema())
126
 
126
 
127
     @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
127
     @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
128
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
128
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
129
-    @hapic.handle_exception(InsufficientUserWorkspaceRole, HTTPStatus.FORBIDDEN)
129
+    @hapic.handle_exception(InsufficientUserRoleInWorkspace, HTTPStatus.FORBIDDEN)
130
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
130
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
131
     @require_workspace_role(UserRoleInWorkspace.CONTRIBUTOR)
131
     @require_workspace_role(UserRoleInWorkspace.CONTRIBUTOR)
132
     @hapic.input_path(WorkspaceIdPathSchema())
132
     @hapic.input_path(WorkspaceIdPathSchema())
160
     @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
160
     @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
161
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
161
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
162
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
162
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
163
-    @hapic.handle_exception(InsufficientUserWorkspaceRole, HTTPStatus.FORBIDDEN)
163
+    @hapic.handle_exception(InsufficientUserRoleInWorkspace, HTTPStatus.FORBIDDEN)
164
     @hapic.handle_exception(WorkspacesDoNotMatch, HTTPStatus.BAD_REQUEST)
164
     @hapic.handle_exception(WorkspacesDoNotMatch, HTTPStatus.BAD_REQUEST)
165
     @require_workspace_role(UserRoleInWorkspace.CONTENT_MANAGER)
165
     @require_workspace_role(UserRoleInWorkspace.CONTENT_MANAGER)
166
     @require_candidate_workspace_role(UserRoleInWorkspace.CONTENT_MANAGER)
166
     @require_candidate_workspace_role(UserRoleInWorkspace.CONTENT_MANAGER)
214
 
214
 
215
     @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
215
     @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
216
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
216
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
217
-    @hapic.handle_exception(InsufficientUserWorkspaceRole, HTTPStatus.FORBIDDEN)
217
+    @hapic.handle_exception(InsufficientUserRoleInWorkspace, HTTPStatus.FORBIDDEN)
218
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
218
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
219
     @require_workspace_role(UserRoleInWorkspace.CONTENT_MANAGER)
219
     @require_workspace_role(UserRoleInWorkspace.CONTENT_MANAGER)
220
     @hapic.input_path(WorkspaceAndContentIdPathSchema())
220
     @hapic.input_path(WorkspaceAndContentIdPathSchema())
249
 
249
 
250
     @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
250
     @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
251
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
251
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
252
-    @hapic.handle_exception(InsufficientUserWorkspaceRole, HTTPStatus.FORBIDDEN)
252
+    @hapic.handle_exception(InsufficientUserRoleInWorkspace, HTTPStatus.FORBIDDEN)
253
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
253
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
254
     @require_workspace_role(UserRoleInWorkspace.CONTENT_MANAGER)
254
     @require_workspace_role(UserRoleInWorkspace.CONTENT_MANAGER)
255
     @hapic.input_path(WorkspaceAndContentIdPathSchema())
255
     @hapic.input_path(WorkspaceAndContentIdPathSchema())
285
 
285
 
286
     @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
286
     @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
287
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
287
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
288
-    @hapic.handle_exception(InsufficientUserWorkspaceRole, HTTPStatus.FORBIDDEN)
288
+    @hapic.handle_exception(InsufficientUserRoleInWorkspace, HTTPStatus.FORBIDDEN)
289
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
289
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
290
     @require_workspace_role(UserRoleInWorkspace.CONTENT_MANAGER)
290
     @require_workspace_role(UserRoleInWorkspace.CONTENT_MANAGER)
291
     @hapic.input_path(WorkspaceAndContentIdPathSchema())
291
     @hapic.input_path(WorkspaceAndContentIdPathSchema())
317
 
317
 
318
     @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
318
     @hapic.with_api_doc(tags=[WORKSPACE_ENDPOINTS_TAG])
319
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
319
     @hapic.handle_exception(NotAuthenticated, HTTPStatus.UNAUTHORIZED)
320
-    @hapic.handle_exception(InsufficientUserWorkspaceRole, HTTPStatus.FORBIDDEN)
320
+    @hapic.handle_exception(InsufficientUserRoleInWorkspace, HTTPStatus.FORBIDDEN)
321
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
321
     @hapic.handle_exception(WorkspaceNotFound, HTTPStatus.FORBIDDEN)
322
     @require_workspace_role(UserRoleInWorkspace.CONTENT_MANAGER)
322
     @require_workspace_role(UserRoleInWorkspace.CONTENT_MANAGER)
323
     @hapic.input_path(WorkspaceAndContentIdPathSchema())
323
     @hapic.input_path(WorkspaceAndContentIdPathSchema())