I have read this below answer for SPA cons. In fact, I have faced some problems outlined.
Single Page Application: advantages and disadvantages
That is why I want to check I still taking the current path.
My question is more related to user authorization to an object.
- When the user access the web app who doesn't have authorization to certain objects, do I need to hide them (with JS) in SPA or I need to make all the options available as API.
Ex: if the user is not admin, need to hide admin related navigation links, or do I need to create an API for navigation links and maintain in the server.
- User logged into the application and the data table was loaded. But the user doesn't have the delete permission on the data. Do I need to hide the delete option on records? or page can be build based on permission?
So far, for navigation, I keep the entries in the backend and serve as API. To delete permission like things, I hide it.
I am using Angular. Is there any solution I can build SPA on based on user permission or MPA is better for my use case, as it is data sensitive and I don't want users to inspect the elements and figure things what was hidden (authentication is set for API as well. but I feel too much work to be done to maintain simple edit feature and navigation when user permission involves.)