|
@@ -21,7 +21,7 @@ class AnnotationReplyActionApi(Resource):
|
|
|
@cloud_edition_billing_resource_check('annotation')
|
|
|
def post(self, app_id, action):
|
|
|
# The role of the current user in the ta table must be admin or owner
|
|
|
- if current_user.current_tenant.current_role not in ['admin', 'owner']:
|
|
|
+ if not current_user.is_admin_or_owner:
|
|
|
raise Forbidden()
|
|
|
|
|
|
app_id = str(app_id)
|
|
@@ -45,7 +45,7 @@ class AppAnnotationSettingDetailApi(Resource):
|
|
|
@account_initialization_required
|
|
|
def get(self, app_id):
|
|
|
# The role of the current user in the ta table must be admin or owner
|
|
|
- if current_user.current_tenant.current_role not in ['admin', 'owner']:
|
|
|
+ if not current_user.is_admin_or_owner:
|
|
|
raise Forbidden()
|
|
|
|
|
|
app_id = str(app_id)
|
|
@@ -59,7 +59,7 @@ class AppAnnotationSettingUpdateApi(Resource):
|
|
|
@account_initialization_required
|
|
|
def post(self, app_id, annotation_setting_id):
|
|
|
# The role of the current user in the ta table must be admin or owner
|
|
|
- if current_user.current_tenant.current_role not in ['admin', 'owner']:
|
|
|
+ if not current_user.is_admin_or_owner:
|
|
|
raise Forbidden()
|
|
|
|
|
|
app_id = str(app_id)
|
|
@@ -80,7 +80,7 @@ class AnnotationReplyActionStatusApi(Resource):
|
|
|
@cloud_edition_billing_resource_check('annotation')
|
|
|
def get(self, app_id, job_id, action):
|
|
|
# The role of the current user in the ta table must be admin or owner
|
|
|
- if current_user.current_tenant.current_role not in ['admin', 'owner']:
|
|
|
+ if not current_user.is_admin_or_owner:
|
|
|
raise Forbidden()
|
|
|
|
|
|
job_id = str(job_id)
|
|
@@ -108,7 +108,7 @@ class AnnotationListApi(Resource):
|
|
|
@account_initialization_required
|
|
|
def get(self, app_id):
|
|
|
# The role of the current user in the ta table must be admin or owner
|
|
|
- if current_user.current_tenant.current_role not in ['admin', 'owner']:
|
|
|
+ if not current_user.is_admin_or_owner:
|
|
|
raise Forbidden()
|
|
|
|
|
|
page = request.args.get('page', default=1, type=int)
|
|
@@ -133,7 +133,7 @@ class AnnotationExportApi(Resource):
|
|
|
@account_initialization_required
|
|
|
def get(self, app_id):
|
|
|
# The role of the current user in the ta table must be admin or owner
|
|
|
- if current_user.current_tenant.current_role not in ['admin', 'owner']:
|
|
|
+ if not current_user.is_admin_or_owner:
|
|
|
raise Forbidden()
|
|
|
|
|
|
app_id = str(app_id)
|
|
@@ -152,7 +152,7 @@ class AnnotationCreateApi(Resource):
|
|
|
@marshal_with(annotation_fields)
|
|
|
def post(self, app_id):
|
|
|
# The role of the current user in the ta table must be admin or owner
|
|
|
- if current_user.current_tenant.current_role not in ['admin', 'owner']:
|
|
|
+ if not current_user.is_admin_or_owner:
|
|
|
raise Forbidden()
|
|
|
|
|
|
app_id = str(app_id)
|
|
@@ -172,7 +172,7 @@ class AnnotationUpdateDeleteApi(Resource):
|
|
|
@marshal_with(annotation_fields)
|
|
|
def post(self, app_id, annotation_id):
|
|
|
# The role of the current user in the ta table must be admin or owner
|
|
|
- if current_user.current_tenant.current_role not in ['admin', 'owner']:
|
|
|
+ if not current_user.is_admin_or_owner:
|
|
|
raise Forbidden()
|
|
|
|
|
|
app_id = str(app_id)
|
|
@@ -189,7 +189,7 @@ class AnnotationUpdateDeleteApi(Resource):
|
|
|
@account_initialization_required
|
|
|
def delete(self, app_id, annotation_id):
|
|
|
# The role of the current user in the ta table must be admin or owner
|
|
|
- if current_user.current_tenant.current_role not in ['admin', 'owner']:
|
|
|
+ if not current_user.is_admin_or_owner:
|
|
|
raise Forbidden()
|
|
|
|
|
|
app_id = str(app_id)
|
|
@@ -205,7 +205,7 @@ class AnnotationBatchImportApi(Resource):
|
|
|
@cloud_edition_billing_resource_check('annotation')
|
|
|
def post(self, app_id):
|
|
|
# The role of the current user in the ta table must be admin or owner
|
|
|
- if current_user.current_tenant.current_role not in ['admin', 'owner']:
|
|
|
+ if not current_user.is_admin_or_owner:
|
|
|
raise Forbidden()
|
|
|
|
|
|
app_id = str(app_id)
|
|
@@ -230,7 +230,7 @@ class AnnotationBatchImportStatusApi(Resource):
|
|
|
@cloud_edition_billing_resource_check('annotation')
|
|
|
def get(self, app_id, job_id):
|
|
|
# The role of the current user in the ta table must be admin or owner
|
|
|
- if current_user.current_tenant.current_role not in ['admin', 'owner']:
|
|
|
+ if not current_user.is_admin_or_owner:
|
|
|
raise Forbidden()
|
|
|
|
|
|
job_id = str(job_id)
|
|
@@ -257,7 +257,7 @@ class AnnotationHitHistoryListApi(Resource):
|
|
|
@account_initialization_required
|
|
|
def get(self, app_id, annotation_id):
|
|
|
# The role of the current user in the table must be admin or owner
|
|
|
- if current_user.current_tenant.current_role not in ['admin', 'owner']:
|
|
|
+ if not current_user.is_admin_or_owner:
|
|
|
raise Forbidden()
|
|
|
|
|
|
page = request.args.get('page', default=1, type=int)
|