angulartypescriptmodal-dialogangular-routing

Can I use Angular route-guards for modals?


So I am trying to build an Angular SPA and want to restrict access for the editing dialogs. All my editing dialogs are displayed in a large modal window. So if users don't have editing rights, they shouldn't be able to open the modal at all, or only some of its content. Currently, the URL never changes when I open a modal. But I am not sure how to protect the editing functionality if I cannot specify a specific path... Should I now try to programmatically change the URL when opening a modal, or are there better ways to protect modals? If I need to move away from modals to achieve a user restriction, this would also be good to know.

Otherwise I would just hide the buttons for users without the required rights. Is that enough?

Thanks in advance!


Solution

  • In the end it's your decision, but keep in mind these points when you make the change.