Skip to content

Commit

Permalink
Update forbidden resource message
Browse files Browse the repository at this point in the history
  • Loading branch information
mawandm committed Apr 10, 2024
1 parent 2ac5a8d commit 2fc46df
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions nesis/api/core/controllers/datasources.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def operate_datasources():
except util.UnauthorizedAccess:
return jsonify(error_message("Unauthorized access")), 401
except util.PermissionException:
return jsonify(error_message("Forbidden resource")), 403
return jsonify(error_message("Forbidden action on resource")), 403
except util.ValidationException:
return jsonify(error_message("Unable to validate datasource connection")), 403
except:
Expand Down Expand Up @@ -88,7 +88,7 @@ def operate_datasource(datasource_id):
except util.UnauthorizedAccess:
return jsonify(error_message("Unauthorized access")), 401
except util.PermissionException:
return jsonify(error_message("Forbidden resource")), 403
return jsonify(error_message("Forbidden action on resource")), 403
except:
_LOG.exception("Error getting user")
return jsonify(error_message("Server error")), 500
14 changes: 7 additions & 7 deletions nesis/api/core/controllers/management.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def operate_users():
except util.UnauthorizedAccess:
return jsonify(error_message("Unauthorized access")), 401
except util.PermissionException:
return jsonify(error_message("Forbidden resource")), 403
return jsonify(error_message("Forbidden action on resource")), 403
except:
_LOG.exception("Error getting user")
return jsonify(error_message("Server error")), 500
Expand Down Expand Up @@ -66,7 +66,7 @@ def operate_user(user_id):
except util.UnauthorizedAccess:
return jsonify(error_message("Unauthorized access")), 401
except util.PermissionException:
return jsonify(error_message("Forbidden resource")), 403
return jsonify(error_message("Forbidden action on resource")), 403
except:
_LOG.exception("Error getting user")
return jsonify(error_message("Server error")), 500
Expand All @@ -91,7 +91,7 @@ def operate_user_roles(user_id):
except util.UnauthorizedAccess:
return jsonify(error_message("Unauthorized access")), 401
except util.PermissionException:
return jsonify(error_message("Forbidden resource")), 403
return jsonify(error_message("Forbidden action on resource")), 403
except:
_LOG.exception("Error getting user")
return jsonify(error_message("Server error")), 500
Expand All @@ -108,7 +108,7 @@ def operate_user_role(user_id, role_id):
except util.UnauthorizedAccess:
return jsonify(error_message("Unauthorized access")), 401
except util.PermissionException:
return jsonify(error_message("Forbidden resource")), 403
return jsonify(error_message("Forbidden action on resource")), 403
except:
_LOG.exception("Error getting user")
return jsonify(error_message("Server error")), 500
Expand All @@ -133,7 +133,7 @@ def operate_roles():
except util.UnauthorizedAccess:
return jsonify(error_message("Unauthorized access")), 401
except util.PermissionException:
return jsonify(error_message("Forbidden resource")), 403
return jsonify(error_message("Forbidden action on resource")), 403
except:
_LOG.exception("Error getting user")
return jsonify(error_message("Server error")), 500
Expand Down Expand Up @@ -177,7 +177,7 @@ def operate_role(role_id):
except util.ServiceException as se:
return jsonify(error_message(str(se))), 400
except util.PermissionException:
return jsonify(error_message("Forbidden resource")), 403
return jsonify(error_message("Forbidden action on resource")), 403
except util.UnauthorizedAccess:
return jsonify(error_message("Unauthorized access")), 401

Expand All @@ -197,7 +197,7 @@ def operate_sessions():
except util.UnauthorizedAccess:
return jsonify(error_message("Unauthorized access")), 401
except util.PermissionException:
return jsonify(error_message("Forbidden resource")), 403
return jsonify(error_message("Forbidden action on resource")), 403
except:
_LOG.exception("Error operating session")
return jsonify(error_message("Server error")), 500
2 changes: 1 addition & 1 deletion nesis/api/core/controllers/predictions.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def operate_module_predictions(module):
except util.UnauthorizedAccess:
return jsonify(error_message("Unauthorized access")), 401
except util.PermissionException:
return jsonify(error_message("Forbidden resource")), 403
return jsonify(error_message("Forbidden action on resource")), 403
except:
_LOG.exception("Error getting user")
return jsonify(error_message("Server error")), 500
4 changes: 2 additions & 2 deletions nesis/api/core/controllers/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def operate_settings(module):
except util.UnauthorizedAccess:
return jsonify(error_message("Unauthorized access")), 401
except util.PermissionException:
return jsonify(error_message("Forbidden resource")), 403
return jsonify(error_message("Forbidden action on resource")), 403
except:
_LOG.exception("Error getting user")
return jsonify(error_message("Server error")), 500
Expand Down Expand Up @@ -66,7 +66,7 @@ def operate_setting(module, setting_id):
except util.UnauthorizedAccess:
return jsonify(error_message("Unauthorized access")), 401
except util.PermissionException:
return jsonify(error_message("Forbidden resource")), 403
return jsonify(error_message("Forbidden action on resource")), 403
except:
_LOG.exception("Error getting user")
return jsonify(error_message("Server error")), 500

0 comments on commit 2fc46df

Please sign in to comment.