You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to customize the error messages. For example, if a user with role of "Buyer" is trying to access my resource but grants object doesn't contain the role called "Buyer" and accesscontrol will throw "Role not found: \"Buyer\"". Here I want to take the control of error block either synchronously/asynchronously and customize the error message and send to the end point. Please provide if any one knows have done it previously.
Thanks
The text was updated successfully, but these errors were encountered:
The user does/should not define his/her own role.
You should pre-define the roles, resources, etc...
Then if you have the role Buyer added to the instance, it will not throw Role not found.
It will simply deny permission to that user (if not Buyer).
Apart from this; to answer your question,
You can catch and re-throw an error, or modify the message before sent/shown to user.
I need to customize the error messages. For example, if a user with role of "
Buyer
" is trying to access my resource but grants object doesn't contain the role called "Buyer
" andaccesscontrol
will throw "Role not found: \"Buyer\"
". Here I want to take the control of error block either synchronously/asynchronously and customize the error message and send to the end point. Please provide if any one knows have done it previously.Thanks
The text was updated successfully, but these errors were encountered: